feat: 添加结算功能,更新 TicketItem 模型以支持最新结算详情,增强 DrawTickService 以自动处理结算,更新 TicketWalletService 以支持派彩入账,扩展 API 路由以管理结算批次和奖池

This commit is contained in:
2026-05-11 15:34:34 +08:00
parent 6a55fa9592
commit 19003f5041
50 changed files with 3604 additions and 3 deletions

View File

@@ -10,6 +10,7 @@ use App\Models\Player;
use App\Models\TicketCombination;
use App\Models\TicketItem;
use App\Models\TicketOrder;
use App\Services\Jackpot\JackpotContributionService;
use Illuminate\Support\Facades\DB;
final class TicketPlacementService
@@ -19,6 +20,7 @@ final class TicketPlacementService
private readonly PlayRuleEngine $ruleEngine,
private readonly RiskPoolService $riskPoolService,
private readonly TicketWalletService $ticketWalletService,
private readonly JackpotContributionService $jackpotContribution,
) {}
/**
@@ -151,6 +153,8 @@ final class TicketPlacementService
$lockedAmount = $this->riskPoolService->acquire((int) $draw->id, $item, $locks);
$item->forceFill(['risk_locked_amount' => $lockedAmount])->save();
$this->jackpotContribution->recordFromPlacedTicketItem($item, $draw, $currencyCode);
}
return $order;