feat: 支持开奖重开与风险池原子扣减,完善投注部分成功流程
This commit is contained in:
@@ -88,7 +88,11 @@ final class DrawRngRunner
|
||||
->where('status', DrawStatus::Closed->value)
|
||||
->whereNotNull('draw_time')
|
||||
->where('draw_time', '<=', $nowUtc)
|
||||
->whereDoesntHave('resultBatches')
|
||||
->where('settle_version', 0)
|
||||
->where(function ($q): void {
|
||||
$q->where('is_reopened', true)
|
||||
->orWhereDoesntHave('resultBatches');
|
||||
})
|
||||
->orderBy('draw_time')
|
||||
->pluck('id');
|
||||
|
||||
@@ -100,7 +104,10 @@ final class DrawRngRunner
|
||||
if ($locked === null || $locked->status !== DrawStatus::Closed->value) {
|
||||
return;
|
||||
}
|
||||
if ($locked->resultBatches()->exists()) {
|
||||
if ((int) $locked->settle_version > 0) {
|
||||
return;
|
||||
}
|
||||
if (! (bool) $locked->is_reopened && $locked->resultBatches()->exists()) {
|
||||
return;
|
||||
}
|
||||
$this->executeLocked($locked);
|
||||
|
||||
Reference in New Issue
Block a user