1.优化管理员提现记录审核为一个操作

2.修复创建玩家报错“参数%s不能为空”
3.修复玩家登录报错
This commit is contained in:
2026-05-30 18:27:26 +08:00
parent 9a3f3b747f
commit 75e91fee13
11 changed files with 438 additions and 98 deletions

View File

@@ -177,12 +177,15 @@ class Auth extends \ba\Auth
} elseif (preg_match('/^[a-zA-Z][a-zA-Z0-9_]{2,15}$/', $username)) {
$accountType = 'username';
}
if (!$accountType) {
$this->setError('Account not exist');
return false;
if ($accountType) {
$this->model = User::where($accountType, $username)->find();
} else {
// 兼容历史纯数字账号、带 + 前缀手机号等非标准格式
$this->model = User::where('username', $username)->whereOr('phone', $username)->find();
if (!$this->model && str_starts_with($username, '+')) {
$this->model = User::where('phone', substr($username, 1))->find();
}
}
$this->model = User::where($accountType, $username)->find();
if (!$this->model) {
$this->setError('Account not exist');
return false;
@@ -204,7 +207,7 @@ class Auth extends \ba\Auth
if ($this->model->login_failure > 0 && $lastLoginTs > 0 && time() - $lastLoginTs >= 86400) {
$this->model->login_failure = 0;
$this->model->save();
$this->model = User::where($accountType, $username)->find();
$this->model = User::find($this->model->id);
}
if ($this->model->login_failure >= $userLoginRetry) {
$this->setError('Please try again after 1 day');