feat: 增强奖池与钱包管理功能

更新 AdminJackpotPoolUpdateController 校验规则,禁止传入 current_amount。
优化 AdminRiskPoolManualStatusController:更新奖池状态后同步 Redis 状态。
在 TransferOrderReconcileController 中新增 completeCredit 方法,用于处理卡住的转账订单对账。
调整 TransferOrderListController:优化转账订单处理条件。
在 TicketItemsIndexController 中实现支持时区的日期筛选,提升日期处理准确性。
扩展 JackpotPool 模型,新增 adjustments 关联关系。
改进票据与钱包相关服务中的错误处理和事务管理。
This commit is contained in:
2026-05-26 14:58:41 +08:00
parent 48349e3302
commit c8c90e3e94
45 changed files with 1877 additions and 104 deletions

View File

@@ -6,9 +6,11 @@ use App\Models\Draw;
use App\Models\AdminUser;
use App\Lottery\DrawStatus;
use App\Models\DrawResultBatch;
use App\Models\SettlementBatch;
use Illuminate\Support\Facades\DB;
use App\Services\LotterySettings;
use App\Lottery\DrawResultBatchStatus;
use App\Lottery\SettlementBatchStatus;
/**
* 人工审核通过后发布结果;或 RNG 自动生成路径内联调用同一事务字段更新。
@@ -114,10 +116,28 @@ final class DrawPublishService
DrawStatus::Closed->value,
DrawStatus::Review->value,
DrawStatus::Cooldown->value,
DrawStatus::Settling->value,
];
if (! in_array($draw->status, $allowed, true)) {
throw new \RuntimeException('draw_not_ready_to_publish');
}
$this->assertNoActiveSettlementWorkflow($draw);
}
/** 存在未完结结算批次时不允许改发布结果,避免派彩与大厅展示号码不一致。 */
private function assertNoActiveSettlementWorkflow(Draw $draw): void
{
$active = SettlementBatch::query()
->where('draw_id', $draw->id)
->whereIn('status', [
SettlementBatchStatus::Running->value,
SettlementBatchStatus::PendingReview->value,
SettlementBatchStatus::Approved->value,
])
->exists();
if ($active) {
throw new \RuntimeException('draw_settlement_in_progress');
}
}
}