feat(risk): 支持按开注商隔离风险池并新增经营报表
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Services\Draw;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use App\Models\BetProvider;
|
||||
use App\Models\Draw;
|
||||
use App\Models\RiskPool;
|
||||
use App\Lottery\DrawStatus;
|
||||
@@ -335,6 +336,7 @@ final class DrawHallSnapshotBuilder
|
||||
return Cache::remember($cacheKey, self::RISK_ALERTS_CACHE_TTL_SECONDS, function () use ($drawId): array {
|
||||
return RiskPool::query()
|
||||
->where('draw_id', $drawId)
|
||||
->where('provider_code', BetProvider::DEFAULT_CODE)
|
||||
->where(function ($q): void {
|
||||
$q->where('sold_out_status', 1)
|
||||
->orWhereRaw('(locked_amount * 1.0 / NULLIF(total_cap_amount, 0)) >= 0.8');
|
||||
|
||||
Reference in New Issue
Block a user