コード例 #1
0
ファイル: UserSearch.php プロジェクト: weiyiyi/base
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = User::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $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, 'status' => $this->status, 'last_login_time' => $this->last_login_time, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, 'delect' => $this->delect]);
     $query->andFilterWhere(['like', 'email', $this->email])->andFilterWhere(['like', 'password_hash', $this->password_hash])->andFilterWhere(['like', 'zipcode', $this->zipcode])->andFilterWhere(['like', 'password_reset_token', $this->password_reset_token])->andFilterWhere(['like', 'last_name', $this->last_name])->andFilterWhere(['like', 'client_name', $this->client_name])->andFilterWhere(['like', 'phone', $this->phone])->andFilterWhere(['like', 'state', $this->state])->andFilterWhere(['like', 'city', $this->city])->andFilterWhere(['like', 'street', $this->street])->andFilterWhere(['like', 'time_zone', $this->time_zone])->andFilterWhere(['like', 'channels', $this->channels])->andFilterWhere(['like', 'register_ip', $this->register_ip])->andFilterWhere(['like', 'last_login_ip', $this->last_login_ip])->andFilterWhere(['like', 'avatar_img', $this->avatar_img])->andFilterWhere(['like', 'username', $this->username])->andFilterWhere(['like', 'auth_key', $this->auth_key])->andFilterWhere(['like', 'accessToken', $this->accessToken]);
     return $dataProvider;
 }
コード例 #2
0
ファイル: UserSearch.php プロジェクト: apuc/api
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = User::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $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, 'money' => $this->money, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, 'status' => $this->status]);
     $query->andFilterWhere(['like', 'cash_id', $this->cash_id])->andFilterWhere(['like', 'email', $this->email])->andFilterWhere(['like', 'password', $this->password])->andFilterWhere(['like', 'salt', $this->salt])->andFilterWhere(['like', 'username', $this->username])->andFilterWhere(['like', 'auth_key', $this->auth_key])->andFilterWhere(['like', 'photo', $this->photo]);
     return $dataProvider;
 }