createQuery() ->joinWith( [ 'lang', 'categories.lang', ] ); // add conditions that should always apply here $dataProvider = new ActiveDataProvider( [ 'query' => $query, 'pagination' => [ 'pageSize' => 50, ], ] ); $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; } // grid filtering conditions $query->andFilterWhere( [ 'id' => $this->id, 'is_filter' => $this->is_filter, 'sort' => $this->sort, 'status' => $this->status, 'in_menu' => $this->in_menu, ] ); $query->andFilterWhere( [ 'ilike', 'category_lang.title', $this->category, ] ); return $dataProvider; } /** * @inheritdoc */ public function getCategories() { return Category::find(); } /** * @inheritdoc */ public function getOptions() { } /** * Return ActiveQueyr for current model * * @return \yii\db\ActiveQuery */ abstract protected function createQuery(): ActiveQuery; }