$query, 'sort' => [ 'defaultOrder' => [ 'id' => SORT_DESC ] ] ]); $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, 'level_id' => $this->level_id, ]); $query->andFilterWhere(['like', 'nickname', $this->nickname]) ->andFilterWhere(['like', 'tel', $this->tel]) ->andFilterWhere(['like', 'access_token', $this->access_token]) ->andFilterWhere(['like', 'openid', $this->openid]); return $dataProvider; } }