fix: 修复并发竞态与幂等性缺陷并优化子树查询
Some checks failed
lotterLaravel CI / test (push) Has been cancelled

- 扩大玩家ID随机数位宽降低碰撞概率
- 授信额度变更加 lockForUpdate 防并发下调
- 结算冲正与入账利用唯一索引实现幂等闸门
- 失败登录计数加锁防丢失
- 代理子树查询改用子查询替代全表 pluck
- 修复返点默认值百分比单位转换
- 测试中全量 fake 广播事件防 CI 500
This commit is contained in:
2026-06-18 09:38:24 +08:00
parent 2e0b257160
commit 6b2ea39ea1
13 changed files with 400 additions and 135 deletions

View File

@@ -351,7 +351,9 @@ test('jackpot contribution uses total bet amount instead of actual deduct amount
});
test('jackpot bursts by configured play combination trigger before threshold', function (): void {
Event::fake([JackpotBurstBroadcast::class]);
// 该 case 切到 reverb driver必须 fake 流程中所有可能触发的 Broadcast 事件,
// 否则 fake 列表外的广播会真实连接 Reverb/Pusher在 CI 环境抛 500。
Event::fake(allBroadcastEvents());
config([
'broadcasting.default' => 'reverb',
'broadcasting.connections.reverb.driver' => 'reverb',

View File

@@ -428,7 +428,9 @@ test('play type patch toggles active config and broadcasts instantly', function
});
test('§9 play_config publish broadcasts changed play toggles', function (): void {
Event::fake([PlayToggleBroadcast::class]);
// fake 流程中可能触发的全部 BroadcastPlayToggle / PlayCatalogUpdated / DrawStatusChange 等),
// 否则未在 fake 列表中的事件会真实连接 Reverb/PusherCI 环境抛 500。
Event::fake(allBroadcastEvents());
config([
'broadcasting.default' => 'reverb',
'broadcasting.connections.reverb.driver' => 'reverb',
@@ -459,7 +461,9 @@ test('§9 play_config publish broadcasts changed play toggles', function (): voi
});
test('§9 odds publish broadcasts odds update', function (): void {
Event::fake([OddsUpdateBroadcast::class]);
// fake 流程中可能触发的全部 BroadcastOddsUpdate / PlayCatalogUpdated / DrawStatusChange 等),
// 否则未在 fake 列表中的事件会真实连接 Reverb/PusherCI 环境抛 500。
Event::fake(allBroadcastEvents());
config([
'broadcasting.default' => 'reverb',
'broadcasting.connections.reverb.driver' => 'reverb',