$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([ 'uid' => $this->uid, 'reg_time' => $this->reg_time, 'reg_ip' => $this->reg_ip, 'last_login_time' => $this->last_login_time, 'last_login_ip' => $this->last_login_ip, 'update_time' => $this->update_time, 'status' => $this->status, ]); $query->andFilterWhere(['like', 'username', $this->username]) ->andFilterWhere(['like', 'password', $this->password]) ->andFilterWhere(['like', 'salt', $this->salt]) ->andFilterWhere(['like', 'email', $this->email]) ->andFilterWhere(['like', 'mobile', $this->mobile]); /* 排序 */ $query->orderBy([ 'uid' => SORT_ASC, ]); return $dataProvider; } }