$query, 'pagination' => [ 'pageSize' => 10, ], ]); $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->andFilterWhere([ 'id' => $this->id, 'group' => $this->group, 'type' => $this->type, 'create_time' => $this->create_time, 'update_time' => $this->update_time, 'sort' => $this->sort, 'status' => $this->status, ]); $query->andFilterWhere(['like', 'name', $this->name]) ->andFilterWhere(['like', 'title', $this->title]) ->andFilterWhere(['like', 'value', $this->value]) ->andFilterWhere(['like', 'extra', $this->extra]) ->andFilterWhere(['like', 'remark', $this->remark]); /* 条件搜索 */ /* 排序 */ $query->orderBy([ 'sort' => SORT_ASC, ]); return $dataProvider; } }