/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = DotaTeam::find()->where(['>', 'team_id', 1]); $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(['team_id' => $this->team_id, 'time_created' => $this->time_created, 'rating' => $this->rating, 'games_played_with_current_roster' => $this->games_played_with_current_roster, 'admin_account_id' => $this->admin_account_id]); $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'tag', $this->tag])->andFilterWhere(['like', 'logo', $this->logo])->andFilterWhere(['like', 'logo_sponsor', $this->logo_sponsor])->andFilterWhere(['like', 'country_code', $this->country_code])->andFilterWhere(['like', 'url', $this->url]); return $dataProvider; }