1.优化ws中的jackpot.hit

This commit is contained in:
2026-05-28 15:37:51 +08:00
parent ad63ced9d0
commit cd19c499e2

View File

@@ -148,11 +148,17 @@ final class GameBetSettleService
self::creditUserBetFlow($bet, $now);
$jackpotFlags = ['is_jackpot' => false, 'payout_pending_review' => false];
if (bccomp($win, '0', 2) > 0) {
$jackpotFlags = self::betWinJackpotFlagsForOrder($bet, $win, $needReview);
}
if ($userId > 0) {
if (bccomp($win, '0', 2) > 0) {
$userOutcome[$userId]['had_win'] = true;
}
if (bccomp($win, '0', 2) > 0 && StreakWinReward::isJackpotForStreakAtBet((int) ($bet['streak_at_bet'] ?? 0))) {
// 规则统一:只要 bet.win 判定为中大奖is_jackpot=true就必须广播 jackpot.hit 给所有订阅者
if (bccomp($win, '0', 2) > 0 && ($jackpotFlags['is_jackpot'] ?? false) === true) {
$jackpotNotify[$userId] = true;
}
}
@@ -174,7 +180,6 @@ final class GameBetSettleService
}
if (bccomp($win, '0', 2) > 0) {
$jackpotFlags = self::betWinJackpotFlagsForOrder($bet, $win, $needReview);
if (!isset($winByUser[$userId])) {
$winByUser[$userId] = [
'user_id' => $userId,