feat(draw): 支持多玩法provider及本地化结算时区功能
- Draw相关控制器添加provider_code和provider_name字段支持 - 允许手动录入开奖批次时指定provider_code - RNG开奖批次生成支持多provider,分别生成对应批次数据 - DrawPublishService和DrawManualResultService中支持基于provider_code管理开奖版本和发布流程 - DrawResultViewService调整,支持按provider汇总及筛选开奖结果 - Settlement处理逻辑调整,按provider区分待结算票据及批次,分开结算 - 结算期间管理相关服务支持使用站点本地结算时区计算开账建议和日期处理 - 增加AdminSite的settlement_timezone字段及相关请求验证和数据存取支持 - 优化AdminSettlementPeriod相关代码,防止存在未结清票据时关账 - Ticket明细返回接口添加结算时区信息,提升用户时间体验 - 多处查询排序和版本号处理改进,保证多provider数据正确顺序与一致性
This commit is contained in:
@@ -240,29 +240,32 @@ return Application::configure(basePath: dirname(__DIR__))
|
||||
});
|
||||
})
|
||||
->withSchedule(function (Schedule $schedule): void {
|
||||
$withSingleServerLock = static function ($event) {
|
||||
if (app()->environment('production')) {
|
||||
$event->onOneServer();
|
||||
}
|
||||
|
||||
return $event;
|
||||
};
|
||||
|
||||
/** 开奖时刻后尽快跑 RNG/冷静期,避免大厅在 0:00 卡住最多 1 分钟 */
|
||||
$schedule->command('lottery:draw-tick')
|
||||
$withSingleServerLock($schedule->command('lottery:draw-tick')
|
||||
->everyTenSeconds()
|
||||
->withoutOverlapping(expiresAt: 10)
|
||||
->onOneServer();
|
||||
$schedule->command('lottery:wallet-transfer-reconcile --lookback-hours=24 --stale-minutes=15 --limit=1000')
|
||||
->withoutOverlapping(expiresAt: 10));
|
||||
$withSingleServerLock($schedule->command('lottery:wallet-transfer-reconcile --lookback-hours=24 --stale-minutes=15 --limit=1000')
|
||||
->everyTenMinutes()
|
||||
->withoutOverlapping()
|
||||
->onOneServer();
|
||||
$schedule->command('lottery:ticket-pending-confirm-reconcile --stale-minutes=5 --limit=500')
|
||||
->withoutOverlapping());
|
||||
$withSingleServerLock($schedule->command('lottery:ticket-pending-confirm-reconcile --stale-minutes=5 --limit=500')
|
||||
->everyMinute()
|
||||
->withoutOverlapping()
|
||||
->onOneServer();
|
||||
$schedule->command('settlement:mark-overdue-bills --days=7')
|
||||
->withoutOverlapping());
|
||||
$withSingleServerLock($schedule->command('settlement:mark-overdue-bills --days=7')
|
||||
->dailyAt('02:00')
|
||||
->withoutOverlapping()
|
||||
->onOneServer();
|
||||
->withoutOverlapping());
|
||||
/** @see docs/01-界面文档.md §2.1 `draw.countdown` */
|
||||
if (config('lottery.realtime_hall_countdown', true)) {
|
||||
$schedule->command('lottery:hall-countdown')
|
||||
$withSingleServerLock($schedule->command('lottery:hall-countdown')
|
||||
->everySecond()
|
||||
->withoutOverlapping(expiresAt: 5)
|
||||
->onOneServer();
|
||||
->withoutOverlapping(expiresAt: 5));
|
||||
}
|
||||
})
|
||||
->create();
|
||||
|
||||
Reference in New Issue
Block a user