File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -67,8 +67,10 @@ yii migrate --migrationPath=@vendor/windhoney/yii2-rest-rbac/migrations
67
67
``` php
68
68
yii migrate --migrationPath=@yii/rbac/migrations/
69
69
```
70
- >> ` auth_item ` 表添加一个字段 ` parent_name ` varchar(30) COLLATE utf8_unicode_ci DEFAULT '' COMMENT '父级名称',
71
- > ###### 3. oauth2相关表
70
+
71
+ > ** _ ** ` auth_item ` 表添加一个字段 ` parent_name ` varchar(30) COLLATE utf8_unicode_ci DEFAULT '' COMMENT '父级名称'** _ ** ,
72
+ ###### 3. oauth2相关表
73
+
72
74
``` php
73
75
yii migrate --migrationPath=@vendor/filsh/yii2-oauth2-server/migrations
74
76
```
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ public function up()
21
21
$ this ->createTable ($ userTable , [
22
22
'id ' => $ this ->primaryKey (),
23
23
'username ' => $ this ->string (32 )->notNull (),
24
+ 'realname ' => $ this ->string (100 )->notNull (),
24
25
'auth_key ' => $ this ->string (32 )->notNull (),
25
26
'password_hash ' => $ this ->string ()->notNull (),
26
27
'password_reset_token ' => $ this ->string (),
Original file line number Diff line number Diff line change @@ -55,16 +55,13 @@ public function search($params)
55
55
"role " ,
56
56
"status " ,
57
57
"created_at " ,
58
- // "updated_at",
59
- "store_id " ,
60
- // "dingId"
61
58
]);
62
59
$ query ->andFilterWhere (['like ' , 'username ' , $ this ->username ])
63
60
->andFilterWhere (['like ' , 'auth_key ' , $ this ->auth_key ])
64
61
->andFilterWhere (['like ' , 'password_hash ' , $ this ->password_hash ])
65
62
->andFilterWhere (['like ' , 'password_reset_token ' , $ this ->password_reset_token ])
66
63
->andFilterWhere (['like ' , 'email ' , $ this ->email ]);
67
- $ query ->andWhere (['status ' => 10 ]);
64
+ $ query ->andWhere (['status ' => parent :: STATUS_ACTIVE ]);
68
65
$ query ->orderBy (['id ' => 'asc ' ]);
69
66
$ result = $ query ->asArray ()->all ();
70
67
foreach ($ result as $ key => $ value ) {
@@ -82,7 +79,7 @@ public function allUsers($select = '*')
82
79
{
83
80
$ query = UserModel::find ();
84
81
$ query ->select ($ select );
85
- $ query ->andWhere (['status ' => 10 ]);
82
+ $ query ->andWhere (['status ' => parent :: STATUS_ACTIVE ]);
86
83
$ result = $ query ->asArray ()->all ();
87
84
88
85
return $ result ;
You can’t perform that action at this time.
0 commit comments