1.优化开奖逻辑
2.优化后台开奖派彩 3.优化接口规范
This commit is contained in:
@@ -81,11 +81,15 @@ class User extends Frontend
|
||||
->where('invite_code', $params['invite_code'])
|
||||
->find();
|
||||
if (!$inviterAdmin) {
|
||||
return $this->error(__('Parameter error'));
|
||||
return $this->error(__('Invite code does not exist'));
|
||||
}
|
||||
$ch = $inviterAdmin['channel_id'] ?? null;
|
||||
if ($ch === null || $ch === '' || intval(trim((string) $ch)) <= 0) {
|
||||
return $this->error(__('Invite code not bound to channel'));
|
||||
}
|
||||
$extend['register_invite_code'] = $params['invite_code'];
|
||||
$extend['inviter_admin_id'] = $inviterAdmin['id'];
|
||||
$extend['channel_id'] = $inviterAdmin['channel_id'] ?? null;
|
||||
$extend['admin_id'] = $inviterAdmin['id'];
|
||||
$extend['channel_id'] = intval(trim((string) $ch));
|
||||
}
|
||||
$res = $this->auth->register($params['username'], $params['password'], $params['mobile'], $params['email'], 1, $extend);
|
||||
}
|
||||
@@ -96,6 +100,10 @@ class User extends Frontend
|
||||
'routePath' => '/user'
|
||||
]);
|
||||
}
|
||||
$dup = $this->auth->getRegisterDuplicateKind();
|
||||
if ($params['tab'] === 'register' && ($dup === 'username' || $dup === 'email' || $dup === 'phone')) {
|
||||
return $this->error(__('Account already registered'));
|
||||
}
|
||||
$msg = $this->auth->getError();
|
||||
return $this->error($msg ?: __('Check in failed, please try again or contact the website administrator~'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user