1.优化实时对局页面样式以及自动创建下一局和作废本局的记录

2.新增派彩达到game_config.jackpot_max_amount必须审核才能发放
3.新增游戏对局记录-查看游玩记录btn
3.备份MySQL数据库
This commit is contained in:
2026-04-28 18:25:44 +08:00
parent 4ea83d2818
commit 687257adaa
22 changed files with 945 additions and 208 deletions

View File

@@ -202,7 +202,9 @@ final class GameLiveService
GameHotDataCoordinator::afterUserCommitted($uid);
}
}
GameRecordService::bootstrapPeriodWhenRuntimeEnabled();
// 异常对局作废后:自动暂停游戏,不自动创建新一期;需管理员手动开启「游戏运行」才会重新开局
GameRecordService::setAutoCreateEnabled(false);
GameHotDataCoordinator::afterGameConfigKeyCommitted(GameRecordService::KEY_AUTO_CREATE);
self::publishSnapshot(null);
Log::info('game live startup marked abnormal and refunded', [
'record_id' => $recordId,
@@ -733,6 +735,7 @@ final class GameLiveService
$refundedUserIds = [];
try {
$now = time();
$refund = ['user_ids' => [], 'order_count' => 0, 'total_amount' => '0.00', 'order_ids' => []];
Db::startTrans();
try {
$refund = self::refundPendingBetsSummaryForPeriodLocked($rid, $now);
@@ -750,9 +753,9 @@ final class GameLiveService
Db::rollback();
return ['ok' => false, 'msg' => __('Void failed') . ': ' . $e->getMessage()];
}
GameRecordService::setLiveRuntimeEnabled(false);
GameRecordService::setAutoCreateEnabled(false);
GameHotDataCoordinator::afterGameRecordCommitted($rid);
GameHotDataCoordinator::afterGameConfigKeyCommitted(GameRecordService::KEY_LIVE_RUNTIME);
GameHotDataCoordinator::afterGameConfigKeyCommitted(GameRecordService::KEY_AUTO_CREATE);
foreach ($refundedUserIds as $uid) {
if ($uid > 0) {
GameHotDataCoordinator::afterUserCommitted($uid);
@@ -764,6 +767,7 @@ final class GameLiveService
'ok' => true,
'msg' => __('Period voided'),
'record' => self::reloadRecord($rid),
'refund' => $refund,
];
} finally {
GameHotDataLock::release(GameHotDataLock::TYPE_GAME_RECORD, (string) $rid, $lock['token'], $lock['redis_lock']);
@@ -780,13 +784,14 @@ final class GameLiveService
}
/**
* @return array{user_ids:list<int>,order_count:int,total_amount:string}
* @return array{user_ids:list<int>,order_count:int,total_amount:string,order_ids:list<int>}
*/
private static function refundPendingBetsSummaryForPeriodLocked(int $periodId, int $now): array
{
$userIdSet = [];
$orderCount = 0;
$totalAmount = '0.00';
$orderIds = [];
$bets = Db::name('bet_order')
->where('period_id', $periodId)
->where('status', 1)
@@ -806,6 +811,8 @@ final class GameLiveService
'status' => 3,
'update_time' => $now,
]);
$orderCount++;
$orderIds[] = $betId;
continue;
}
$before = (string) (Db::name('user')->where('id', $userId)->value('coin') ?? '0');
@@ -832,7 +839,7 @@ final class GameLiveService
UserWalletRecord::create([
'user_id' => $userId,
'channel_id' => $channelId,
'biz_type' => 'bet_void',
'biz_type' => 'void_refund',
'direction' => 1,
'amount' => $total,
'balance_before' => $before,
@@ -844,6 +851,7 @@ final class GameLiveService
$userIdSet[$userId] = true;
$orderCount++;
$totalAmount = bcadd($totalAmount, $total, 2);
$orderIds[] = $betId;
}
$out = [];
@@ -855,6 +863,7 @@ final class GameLiveService
'user_ids' => $out,
'order_count' => $orderCount,
'total_amount' => $totalAmount,
'order_ids' => $orderIds,
];
}