Completed
Push — master ( 34d5e7...40545a )
by Xu
566:52 queued 526:59
created
src/models/User.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,6 @@
 block discarded – undo
40 40
  * @property-read boolean $isBlocked 账户是否锁定
41 41
  * @property-read bool $isMobileConfirmed 是否已经手机激活
42 42
  * @property-read bool $isEmailConfirmed 是否已经邮箱激活
43
-
44 43
  *
45 44
  */
46 45
 class User extends ActiveRecord implements IdentityInterface, RateLimitInterface, NotifiableInterface
Please login to merge, or discard this patch.
src/user/models/User.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -41,13 +41,13 @@  discard block
 block discarded – undo
41 41
 class User extends \yuncms\models\User
42 42
 {
43 43
     //场景定义
44
-    const SCENARIO_CREATE = 'create';//后台或控制台创建用户
45
-    const SCENARIO_UPDATE = 'update';//后台或控制台修改用户
46
-    const SCENARIO_REGISTER = 'basic_create';//邮箱注册
47
-    const SCENARIO_EMAIL_REGISTER = 'email_create';//邮箱注册
48
-    const SCENARIO_MOBILE_REGISTER = 'mobile_create';//手机号注册
49
-    const SCENARIO_SETTINGS = 'settings';//更新
50
-    const SCENARIO_CONNECT = 'connect';//账户链接或自动注册新用户
44
+    const SCENARIO_CREATE = 'create'; //后台或控制台创建用户
45
+    const SCENARIO_UPDATE = 'update'; //后台或控制台修改用户
46
+    const SCENARIO_REGISTER = 'basic_create'; //邮箱注册
47
+    const SCENARIO_EMAIL_REGISTER = 'email_create'; //邮箱注册
48
+    const SCENARIO_MOBILE_REGISTER = 'mobile_create'; //手机号注册
49
+    const SCENARIO_SETTINGS = 'settings'; //更新
50
+    const SCENARIO_CONNECT = 'connect'; //账户链接或自动注册新用户
51 51
     const SCENARIO_PASSWORD = 'password';
52 52
 
53 53
     //头像
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     public function behaviors()
71 71
     {
72 72
         $behaviors = parent::behaviors();
73
-        return ArrayHelper::merge($behaviors,[
73
+        return ArrayHelper::merge($behaviors, [
74 74
             'taggable' => [
75 75
                 'class' => TaggableBehavior::class,
76 76
                 'tagValuesAsArray' => true,
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
             static::SCENARIO_EMAIL_REGISTER => ['nickname', 'email', 'password'],
94 94
             static::SCENARIO_MOBILE_REGISTER => ['mobile', 'password'],
95 95
             static::SCENARIO_SETTINGS => ['username', 'email', 'password'],
96
-            static::SCENARIO_CONNECT => ['nickname', 'email', 'password'],//链接账户密码可以为空邮箱可以为空
97
-            static::SCENARIO_PASSWORD => ['password'],//只修改密码
96
+            static::SCENARIO_CONNECT => ['nickname', 'email', 'password'], //链接账户密码可以为空邮箱可以为空
97
+            static::SCENARIO_PASSWORD => ['password'], //只修改密码
98 98
         ]);
99 99
     }
100 100
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public function rules()
106 106
     {
107
-        return ArrayHelper::merge(parent::rules(),[
107
+        return ArrayHelper::merge(parent::rules(), [
108 108
             // nickname rules
109 109
             'nicknameRequired' => ['nickname', 'required', 'on' => [self::SCENARIO_EMAIL_REGISTER, self::SCENARIO_CONNECT]],
110 110
             // email rules
Please login to merge, or discard this patch.
src/user/models/UserProfile.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -52,13 +52,13 @@  discard block
 block discarded – undo
52 52
     const GENDER_FEMALE = 0b10;
53 53
 
54 54
     //当前状态
55
-    const CURRENT_OTHER = 0b0;//其他
56
-    const CURRENT_WORK = 0b1;//正常工作
57
-    const CURRENT_FREELANCE = 0b10;//自由职业者
58
-    const CURRENT_START = 0b11;//创业
59
-    const CURRENT_OUTSOURCE = 0b100;//外包
60
-    const CURRENT_JOB = 0b101;//求职
61
-    const CURRENT_STUDENT = 0b110;//学生
55
+    const CURRENT_OTHER = 0b0; //其他
56
+    const CURRENT_WORK = 0b1; //正常工作
57
+    const CURRENT_FREELANCE = 0b10; //自由职业者
58
+    const CURRENT_START = 0b11; //创业
59
+    const CURRENT_OUTSOURCE = 0b100; //外包
60
+    const CURRENT_JOB = 0b101; //求职
61
+    const CURRENT_STUDENT = 0b110; //学生
62 62
 
63 63
     /**
64 64
      * @inheritdoc
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             [
101 101
                 'mobile',
102 102
                 'yuncms\core\validators\MobileValidator',
103
-                'when' => function ($model) {
103
+                'when' => function($model) {
104 104
                     return $model->country == 'China';
105 105
                 }
106 106
             ],
Please login to merge, or discard this patch.