Kirin před 3 roky
rodič
revize
74cff580fd
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2 2
      app/api/controller/AuthController.php

+ 2 - 2
app/api/controller/AuthController.php

@@ -237,7 +237,7 @@ class AuthController
         }
         if (!$invite_code && User::count() > 0) return app('json')->fail('请输入邀请码');
         if ($invite_code) {
-            $spread = User::where('invite_code', $invite_code)->value('uid');
+            $spread = User::where('invite_code|phone', $invite_code)->value('uid');
             if (!$spread) return app('json')->fail('邀请码不存在');
         }
         if ($phone) {
@@ -260,7 +260,7 @@ class AuthController
             return app('json')->fail('交易密码为6位数字');
 //        if ($password == '123456') return app('json')->fail('密码太过简单,请输入较为复杂的密码');
 //        if ($trade_password == '123456') return app('json')->fail('交易密码太过简单,请输入较为复杂的密码');
-        $spread = User::where('invite_code', $invite_code)->value('uid');
+        $spread = User::where('invite_code|phone', $invite_code)->value('uid');
         $registerStatus = User::register($phone ? $phone : $email, $password, $trade_password, $spread);
         if ($registerStatus) return app('json')->success('注册成功');
         return app('json')->fail(User::getErrorInfo('注册失败'));