示例#1
0
 /**
  * @param $params
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = $this->finder->getUserQuery();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['created_at' => $this->created_at])->andFilterWhere(['like', 'username', $this->username])->andFilterWhere(['like', 'email', $this->email])->andFilterWhere(['registration_ip' => $this->registration_ip]);
     return $dataProvider;
 }
示例#2
0
 /**
  * @param $params
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = $this->finder->getUserQuery();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     if ($this->created_at !== null) {
         $date = strtotime($this->created_at);
         $query->andFilterWhere(['between', 'created_at', $date, $date + 3600 * 24]);
     }
     $query->andFilterWhere(['like', 'username', $this->username])->andFilterWhere(['like', 'email', $this->email])->andFilterWhere(['like', 'profileUser', $this->profileUser->name])->andFilterWhere(['registration_ip' => $this->registration_ip]);
     return $dataProvider;
 }