diff --git a/app/Services/LotteryService.php b/app/Services/LotteryService.php index 9f8e70d..a1a84f8 100644 --- a/app/Services/LotteryService.php +++ b/app/Services/LotteryService.php @@ -86,6 +86,7 @@ class LotteryService $user, $numbers, $issue, $ticketPrice, $poolRatio, $quickPick, &$tickets ) { foreach ($numbers as $idx => $num) { + // ...existing validation/DB storing logic... $reds = $num['reds']; sort($reds); // 红球排序存储,方便比对 @@ -130,6 +131,12 @@ class LotteryService } }); + // 用户成功购买后,发送系统传音广播(大家都能看到他买了彩票) + $firstTicket = $tickets[0]; + $numsStr = $firstTicket->numbersLabel(); + $moreStr = $buyCount > 1 ? "等 {$buyCount} 注号码" : ''; + $this->pushSystemMessage("🎟️ 【双色球彩票】财神爷保佑!玩家【{$user->username}】豪掷千金,购买了当前 #{$issue->issue_no} 期双色球 {$numsStr} {$moreStr},祝 Ta 中大奖!"); + return $tickets; }