优化代理逻辑agent_id

This commit is contained in:
2026-03-19 15:52:06 +08:00
parent 333e85f7d9
commit 3dbd68829a
2 changed files with 84 additions and 3 deletions

View File

@@ -43,11 +43,13 @@ class GameController extends BaseController
}
$adminId = null;
$adminIdsInTopDept = null;
$agentId = trim((string) ($request->agent_id ?? ''));
if ($agentId !== '') {
$systemUser = SystemUser::where('agent_id', $agentId)->find();
if ($systemUser) {
$adminId = (int) $systemUser->id;
$adminIdsInTopDept = UserLogic::getAdminIdsByAgentIdTopDept($agentId);
}
}
@@ -56,7 +58,7 @@ class GameController extends BaseController
try {
$logic = new UserLogic();
$result = $logic->loginByUsername($username, $password, $lang === 'en' ? 'en' : 'chs', 0.0, $time, $adminId);
$result = $logic->loginByUsername($username, $password, $lang === 'en' ? 'en' : 'chs', 0.0, $time, $adminId, $adminIdsInTopDept);
} catch (\plugin\saiadmin\exception\ApiException $e) {
return $this->fail($e->getMessage(), ReturnCode::PARAMS_ERROR);
}