/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Forum::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['id' => $this->id, 'parent' => $this->parent, 'topic_count' => $this->topic_count])->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'description', $this->description])->andFilterWhere(['like', 'icon', $this->icon])->orderBy($order); return $dataProvider; }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Forum::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['id' => $this->id, 'user_id' => $this->user_id, 'created_at' => $this->created_at]); $query->andFilterWhere(['like', 'forum_name', $this->forum_name])->andFilterWhere(['like', 'forum_desc', $this->forum_desc])->andFilterWhere(['like', 'forum_url', $this->forum_url])->andFilterWhere(['like', 'forum_icon', $this->forum_icon]); return $dataProvider; }