$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([ 'option_id' => $this->option_id, 'model_id' => $this->model_id, 'option_pid' => $this->option_pid, 'date_add' => $this->date_add, ]); $query->andFilterWhere(['like', 'model', $this->model]) ->andFilterWhere(['like', 'name', $this->name]) ->andFilterWhere(['like', 'template', $this->template]); return $dataProvider; } }