1.优化玩家抽奖时没有记录dept_id的问题

This commit is contained in:
2026-05-19 14:34:17 +08:00
parent 5cd8330c9e
commit a5e2f2fdf7
3 changed files with 21 additions and 0 deletions

View File

@@ -244,14 +244,19 @@ class GameController extends BaseController
$timeoutRecord = null;
$timeout_message = '';
$adminId = null;
$timeoutDeptId = null;
try {
$timeoutPlayer = DicePlayer::find($userId);
$adminId = ($timeoutPlayer && ($timeoutPlayer->admin_id ?? null)) ? (int) $timeoutPlayer->admin_id : null;
if ($timeoutPlayer && isset($timeoutPlayer->dept_id) && $timeoutPlayer->dept_id !== null && $timeoutPlayer->dept_id !== '') {
$timeoutDeptId = (int) $timeoutPlayer->dept_id;
}
} catch (\Throwable $_) {
}
try {
$timeoutRecord = DicePlayRecord::create([
'player_id' => $userId,
'dept_id' => $timeoutDeptId,
'admin_id' => $adminId,
'lottery_config_id' => 0,
'lottery_type' => 0,