/** * Lists all Post models. * @return mixed */ public function actionIndex() { $searchModel = new PostSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); foreach ($dataProvider->models as $xjj) { Tag::updateFrequency('', $xjj->tags); } return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }
/** * This is invoked after the record is deleted. */ public function afterDelete() { parent::afterDelete(); Comment::deleteAll('post_id = :post_id', [':post_id' => $this->id]); Tag::updateFrequency($this->tags, ''); }
public function afterDelete() { parent::afterDelete(); $Comment = new Comment(); $Comment->deleteAll(['post_id' => $this->id]); $tag = new Tag(); $tag->updateFrequency($this->tags, ''); }
/** * This is invoked after the record is deleted. */ public function afterDelete() { parent::afterDelete(); Comment::deleteAll(['post_id' => $this->id, 'classify_type' => strtolower($this->getClassName())]); Tag::updateFrequency($this->tags, '', strtolower($this->getClassName())); }