255], ['id_producer', 'integer'], ]; } public function search($params) { $optionsSearch = self::getDefaultOptionsSearch() ; $query = UserGroup::find() ->with($optionsSearch['with']) ->innerJoinWith($optionsSearch['join_with'], true) ->where(['user_group.id_producer' => GlobalParam::getCurrentProducerId()]) ; $dataProvider = new ActiveDataProvider([ 'query' => $query, 'sort' => ['attributes' => ['name']], 'pagination' => [ 'pageSize' => 20, ], ]); $this->load($params); if (!$this->validate()) { return $dataProvider; } $query->andFilterWhere(['like', 'user_group.name', $this->name]) ; return $dataProvider; } }