Completed
Push — master ( 919d4e...b4d479 )
by Xu
815:25 queued 774:58
created
src/user/models/User.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
     const AFTER_REGISTER = 'afterRegister';
50 50
 
51 51
     //场景定义
52
-    const SCENARIO_CREATE = 'create';//后台或控制台创建用户
53
-    const SCENARIO_UPDATE = 'update';//后台或控制台修改用户
54
-    const SCENARIO_REGISTER = 'basic_create';//邮箱注册
55
-    const SCENARIO_EMAIL_REGISTER = 'email_create';//邮箱注册
56
-    const SCENARIO_MOBILE_REGISTER = 'mobile_create';//手机号注册
57
-    const SCENARIO_SETTINGS = 'settings';//更新
58
-    const SCENARIO_CONNECT = 'connect';//账户链接或自动注册新用户
52
+    const SCENARIO_CREATE = 'create'; //后台或控制台创建用户
53
+    const SCENARIO_UPDATE = 'update'; //后台或控制台修改用户
54
+    const SCENARIO_REGISTER = 'basic_create'; //邮箱注册
55
+    const SCENARIO_EMAIL_REGISTER = 'email_create'; //邮箱注册
56
+    const SCENARIO_MOBILE_REGISTER = 'mobile_create'; //手机号注册
57
+    const SCENARIO_SETTINGS = 'settings'; //更新
58
+    const SCENARIO_CONNECT = 'connect'; //账户链接或自动注册新用户
59 59
     const SCENARIO_PASSWORD = 'password';
60 60
 
61 61
     //头像
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     public function behaviors()
79 79
     {
80 80
         $behaviors = parent::behaviors();
81
-        return ArrayHelper::merge($behaviors,[
81
+        return ArrayHelper::merge($behaviors, [
82 82
             'taggable' => [
83 83
                 'class' => TaggableBehavior::class,
84 84
                 'tagValuesAsArray' => true,
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
             static::SCENARIO_EMAIL_REGISTER => ['nickname', 'email', 'password'],
102 102
             static::SCENARIO_MOBILE_REGISTER => ['mobile', 'password'],
103 103
             static::SCENARIO_SETTINGS => ['username', 'email', 'password'],
104
-            static::SCENARIO_CONNECT => ['nickname', 'email', 'password'],//链接账户密码可以为空邮箱可以为空
105
-            static::SCENARIO_PASSWORD => ['password'],//只修改密码
104
+            static::SCENARIO_CONNECT => ['nickname', 'email', 'password'], //链接账户密码可以为空邮箱可以为空
105
+            static::SCENARIO_PASSWORD => ['password'], //只修改密码
106 106
         ]);
107 107
     }
108 108
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
      */
113 113
     public function rules()
114 114
     {
115
-        return ArrayHelper::merge(parent::rules(),[
115
+        return ArrayHelper::merge(parent::rules(), [
116 116
             // nickname rules
117 117
             'nicknameRequired' => ['nickname', 'required', 'on' => [self::SCENARIO_EMAIL_REGISTER, self::SCENARIO_CONNECT]],
118 118
             // email rules
Please login to merge, or discard this patch.