/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = SongKingdomComment::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['id' => $this->id, 'song_kingdom_id' => $this->song_kingdom_id, 'comment_id' => $this->comment_id, 'user_id' => $this->user_id, 'comment_type' => $this->comment_type, 'status' => $this->status, 'created_at' => $this->created_at]); $query->andFilterWhere(['like', 'comment_content', $this->comment_content]); return $dataProvider; }
/** * Lists all SongKingdomComment models. * @return mixed */ public function actionIndex() { $dataProvider = new ActiveDataProvider(['query' => SongKingdomComment::find()]); return $this->render('index', ['dataProvider' => $dataProvider]); }