Completed
Push — master ( 332483...d758d7 )
by Xu
106:41 queued 66:43
created
src/user/models/User.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -58,13 +58,13 @@  discard block
 block discarded – undo
58 58
     const AFTER_REGISTER = 'afterRegister';
59 59
 
60 60
     //场景定义
61
-    const SCENARIO_CREATE = 'create';//后台或控制台创建用户
62
-    const SCENARIO_UPDATE = 'update';//后台或控制台修改用户
63
-    const SCENARIO_REGISTER = 'basic_create';//邮箱注册
64
-    const SCENARIO_EMAIL_REGISTER = 'email_create';//邮箱注册
65
-    const SCENARIO_MOBILE_REGISTER = 'mobile_create';//手机号注册
66
-    const SCENARIO_SETTINGS = 'settings';//更新
67
-    const SCENARIO_CONNECT = 'connect';//账户链接或自动注册新用户
61
+    const SCENARIO_CREATE = 'create'; //后台或控制台创建用户
62
+    const SCENARIO_UPDATE = 'update'; //后台或控制台修改用户
63
+    const SCENARIO_REGISTER = 'basic_create'; //邮箱注册
64
+    const SCENARIO_EMAIL_REGISTER = 'email_create'; //邮箱注册
65
+    const SCENARIO_MOBILE_REGISTER = 'mobile_create'; //手机号注册
66
+    const SCENARIO_SETTINGS = 'settings'; //更新
67
+    const SCENARIO_CONNECT = 'connect'; //账户链接或自动注册新用户
68 68
     const SCENARIO_PASSWORD = 'password';
69 69
 
70 70
     /**
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
             static::SCENARIO_EMAIL_REGISTER => ['nickname', 'email', 'password'],
106 106
             static::SCENARIO_MOBILE_REGISTER => ['mobile', 'password'],
107 107
             static::SCENARIO_SETTINGS => ['username', 'email', 'password'],
108
-            static::SCENARIO_CONNECT => ['nickname', 'email', 'password'],//链接账户密码可以为空邮箱可以为空
109
-            static::SCENARIO_PASSWORD => ['password'],//只修改密码
108
+            static::SCENARIO_CONNECT => ['nickname', 'email', 'password'], //链接账户密码可以为空邮箱可以为空
109
+            static::SCENARIO_PASSWORD => ['password'], //只修改密码
110 110
         ]);
111 111
     }
112 112
 
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
         if ($this->balance < 0) {//计算后如果余额小于0,那么结果不合法。
319 319
             return false;
320 320
         }
321
-        $transaction = static::getDb()->beginTransaction();//开始事务
321
+        $transaction = static::getDb()->beginTransaction(); //开始事务
322 322
         try {
323 323
             if ($this->save()) {
324 324
                 $transaction->commit();
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
         if ($this->transfer_balance < 0) {//计算后如果余额小于0,那么结果不合法。
361 361
             return false;
362 362
         }
363
-        $transaction = static::getDb()->beginTransaction();//开始事务
363
+        $transaction = static::getDb()->beginTransaction(); //开始事务
364 364
         try {
365 365
             if ($this->save()) {
366 366
                 $transaction->commit();
Please login to merge, or discard this patch.