typePublic()->andWhere(['>', 'depth', 0]); $dataProvider = new ActiveDataProvider([ 'query' => $query, 'sort' => [ 'defaultOrder' => ['lft' => SORT_ASC] ] ]); $this->load($params); if (!$this->validate()) { $query->where('0=1'); return $dataProvider; } $query->andFilterWhere([ 'id' => $this->id, ]); $query ->andFilterWhere(['like', 'name', $this->name]) ->andFilterWhere(['like', 'slug', $this->slug]) ->andFilterWhere(['like', 'title', $this->title]); return $dataProvider; } }