|
@@ -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位数字');
|
|
|
|
|
|
|
|
|
- $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('注册失败'));
|