$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->joinWith('lang'); // grid filtering conditions $query->andFilterWhere([ 'id' => $this->id, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, 'end_at' => $this->end_at, ]); if($this->lang !== null){ $query->andFilterWhere(['like', 'title', $this->lang->title]) ->andFilterWhere(['like', 'alias', $this->lang->alias]) ->andFilterWhere(['like', 'body', $this->lang->body]) ->andFilterWhere(['like', 'image', $this->image]) ->andFilterWhere(['like', 'meta_title', $this->lang->meta_title]) ->andFilterWhere(['like', 'description', $this->lang->meta_description]) ->andFilterWhere(['like', 'h1', $this->lang->h1]) ->andFilterWhere(['like', 'seo_text', $this->lang->seo_text]); } return $dataProvider; } }