feat: 支持开奖重开与风险池原子扣减,完善投注部分成功流程
This commit is contained in:
@@ -23,7 +23,10 @@ final class DrawRngRunController extends Controller
|
||||
$batch = DB::transaction(function () use ($draw) {
|
||||
/** @var Draw $locked */
|
||||
$locked = Draw::query()->whereKey($draw->id)->lockForUpdate()->firstOrFail();
|
||||
if ($locked->status !== DrawStatus::Closed->value || $locked->resultBatches()->exists()) {
|
||||
if ($locked->status !== DrawStatus::Closed->value || (int) $locked->settle_version > 0) {
|
||||
throw new \RuntimeException('draw_not_runnable');
|
||||
}
|
||||
if (! (bool) $locked->is_reopened && $locked->resultBatches()->exists()) {
|
||||
throw new \RuntimeException('draw_not_runnable');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user