feat: 扩展奖池、风控与报表能力,新增对账补偿、广播和人工操作接口

This commit is contained in:
2026-05-18 15:09:10 +08:00
parent 9157dcb6a1
commit 6ef41cee76
46 changed files with 1889 additions and 98 deletions

View File

@@ -6,6 +6,7 @@ use App\Events\OddsUpdateBroadcast;
use App\Events\PlayToggleBroadcast;
use App\Events\RiskSoldOutBroadcast;
use App\Events\RiskWarningBroadcast;
use App\Events\JackpotBurstBroadcast;
use App\Events\DrawCountdownBroadcast;
use App\Events\DrawStatusChangeBroadcast;
use App\Events\DrawResultPublishedBroadcast;
@@ -13,7 +14,7 @@ use App\Events\DrawResultPublishedBroadcast;
/**
* 对齐界面文档 §2.1:大厅公共频道广播(`lottery-hall`)。
* 包含draw.countdown、draw.status_change、result.published、
* risk.sold_out、risk.warning、play.toggle、odds.update
* risk.sold_out、risk.warning、play.toggle、odds.update、jackpot.burst
*/
final class LotteryHallRealtimeBroadcaster
{
@@ -132,6 +133,34 @@ final class LotteryHallRealtimeBroadcaster
));
}
/** `jackpot.burst` —— Jackpot 爆池动画与浏览器通知 */
public function notifyJackpotBurst(
int $drawId,
string $drawNo,
string $firstPrizeNumber,
string $currencyCode,
int $totalPayoutAmount,
int $winnerCount,
string $triggerType,
int $poolAmountAfter,
): void {
if (! $this->driverSupportsRealtime()) {
return;
}
broadcast(new JackpotBurstBroadcast(
$drawId,
$drawNo,
$firstPrizeNumber,
strtoupper($currencyCode),
$totalPayoutAmount,
$winnerCount,
$triggerType,
$poolAmountAfter,
(int) floor(microtime(true) * 1000),
));
}
private function driverSupportsRealtime(): bool
{
$default = config('broadcasting.default');