$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, 'done' => $this->done, ]); $query->andFilterWhere(['like', 'code', $this->code]) ->andFilterWhere(['like', 'name', $this->name]) ->andFilterWhere(['like', 'value', $this->value]) ->andFilterWhere(['like', 'to_email', $this->to_email]) ->andFilterWhere(['like', 'from_email', $this->from_email]) ->andFilterWhere(['like', 'from_name', $this->from_name]) ->andFilterWhere(['like', 'who_comment', $this->who_comment]); return $dataProvider; } }