$query, ]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere([ 'id' => $this->id, 'rating' => $this->rating, 'spot_id' => $this->spot_id, ]); $query->andFilterWhere(['like', 'photo', $this->photo]) ->andFilterWhere(['like', 'name', $this->name]) ->andFilterWhere(['like', 'address', $this->address]) ->andFilterWhere(['like', 'price', $this->price]) ->andFilterWhere(['like', 'distance', $this->distance]); return $dataProvider; } }