@@ -40,10 +40,10 @@ public function scenarios()
40
40
public function search ($ params )
41
41
{
42
42
$ query = UserModel::find ();
43
- $ this ->load ($ params );
43
+ $ this ->setAttributes ($ params );
44
+ $ status = $ this ->status ?: parent ::STATUS_ACTIVE ;
44
45
$ query ->andFilterWhere ([
45
46
'id ' => $ this ->id ,
46
- 'status ' => $ this ->status ,
47
47
'created_at ' => $ this ->created_at ,
48
48
'updated_at ' => $ this ->updated_at ,
49
49
]);
@@ -56,12 +56,9 @@ public function search($params)
56
56
"status " ,
57
57
"created_at " ,
58
58
]);
59
- $ query ->andFilterWhere (['like ' , 'username ' , $ this ->username ])
60
- ->andFilterWhere (['like ' , 'auth_key ' , $ this ->auth_key ])
61
- ->andFilterWhere (['like ' , 'password_hash ' , $ this ->password_hash ])
62
- ->andFilterWhere (['like ' , 'password_reset_token ' , $ this ->password_reset_token ])
63
- ->andFilterWhere (['like ' , 'email ' , $ this ->email ]);
64
- $ query ->andWhere (['status ' => parent ::STATUS_ACTIVE ]);
59
+ $ query ->andFilterWhere (['like ' , 'username ' , $ this ->username ]);
60
+ $ query ->andFilterWhere (['like ' , 'email ' , $ this ->email ]);
61
+ $ query ->andFilterWhere (['status ' => $ status ]);
65
62
$ query ->orderBy (['id ' => 'asc ' ]);
66
63
$ result = $ query ->asArray ()->all ();
67
64
foreach ($ result as $ key => $ value ) {
0 commit comments