1.修复自动创建下一期bug

This commit is contained in:
2026-05-26 17:57:42 +08:00
parent 5d33b13c6f
commit 6c4e935b6c
5 changed files with 68 additions and 49 deletions

View File

@@ -25,6 +25,8 @@ class Live extends Backend
{
$recordIdRaw = $this->request ? $this->request->get('record_id') : null;
$recordId = is_numeric((string) $recordIdRaw) ? (int) $recordIdRaw : null;
GameLiveService::recoverLiveRoundState();
return $this->success('', GameLiveService::buildSnapshot($recordId));
}
@@ -36,6 +38,8 @@ class Live extends Backend
}
$recordIdRaw = $request->get('record_id');
$recordId = is_numeric((string) $recordIdRaw) ? (int) $recordIdRaw : null;
GameLiveService::recoverLiveRoundState();
return $this->success('', GameLiveService::buildSnapshot($recordId));
}
@@ -173,15 +177,12 @@ class Live extends Backend
return $this->error(is_string($errMsg) ? $errMsg : __('Void failed'));
}
$okMsg = $res['msg'] ?? '';
$snapshot = GameLiveService::buildSnapshot(null);
// 作废本局后:必须关闭自动创建下一局开关(允许管理员后续手动重新开启)
$snapshot['runtime_enabled'] = false;
// 作废后一般不存在进行中的局,直接进入维护态(用于前端展示“维护中”倒计时)
$snapshot['maintenance_ui'] = true;
$snapshot = GameLiveService::buildSnapshotAfterVoid();
$refund = $res['refund'] ?? null;
if (is_array($refund)) {
$snapshot['void_refund'] = $refund;
}
return $this->success(is_string($okMsg) ? $okMsg : '', $snapshot);
}
}