$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, 'finish' => $this->finish, ]); $query->andFilterWhere(['like', 'from_brand', $this->from_brand]) ->andFilterWhere(['like', 'to_brand', $this->to_brand]); return $dataProvider; } }