コード例 #1
0
 public function safeDown()
 {
     $this->dropTable(UserKey::tableName());
     $this->dropTable(Profile::tableName());
     $this->dropTable(User::tableName());
     echo "m140908_144113_Init_DB has been returned.\n";
 }
コード例 #2
0
ファイル: UserSearch.php プロジェクト: dkeeper/yii2-user
 public function search($params)
 {
     $query = User::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'status' => $this->status, 'phone' => $this->phone, 'last_login' => $this->last_login, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, 'ban_to' => $this->ban_to]);
     $query->andFilterWhere(['like', 'username', $this->username])->andFilterWhere(['like', 'login_ip', $this->login_ip])->andFilterWhere(['like', 'create_ip', $this->create_ip])->andFilterWhere(['like', 'email', $this->email])->andFilterWhere(['like', 'ban_reason', $this->ban_reason]);
     return $dataProvider;
 }