$query, 'pagination' => false, ]); $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; } if($this->scenario == self::SCENARIO_PUBLIC) { if(empty( $this->model )) { $this->model = self::DEFAULT_MODEL; }; if(empty( $this->year )) { $this->year = self::DEFAULT_YEAR; }; } // grid filtering conditions $query->andFilterWhere([ 'car_id' => $this->car_id, 'year' => $this->year, 'mileage' => $this->mileage, 'build' => $this->build, 'price' => $this->price, 'model' => $this->model, ]); $query->andFilterWhere([ 'like', 'image', $this->image, ]) ->andFilterWhere([ 'like', 'color', $this->color, ]) ->andFilterWhere([ 'like', 'option', $this->option, ]); return $dataProvider; } }