feat(credit): 实时同步代理已用额度,覆盖玩家下注/结算全流程
- PlayerCreditService 在下注占用、输赢结算、撤单释放等关键节点触发 AgentUsedCreditSyncService - AgentProfileService::present 与 AgentDashboardOverviewBuilder 查询前主动同步 used_credit - 确保代理链 used_credit(团队已用风险)实时反映下级玩家信用占用状态
This commit is contained in:
@@ -8,6 +8,7 @@ use App\Models\AgentProfile;
|
||||
use App\Models\Player;
|
||||
use App\Support\AdminScopeContext;
|
||||
use App\Support\AdminScopeContextResolver;
|
||||
use App\Services\Agent\AgentUsedCreditSyncService;
|
||||
use App\Services\AgentSettlement\ShareLedgerScopedProfitAggregator;
|
||||
use App\Support\AdminAgentSettlementScope;
|
||||
use Carbon\Carbon;
|
||||
@@ -20,6 +21,7 @@ final class AgentDashboardOverviewBuilder
|
||||
public function __construct(
|
||||
private readonly AdminReportQueryService $reportQuery,
|
||||
private readonly ShareLedgerScopedProfitAggregator $shareProfitAggregator,
|
||||
private readonly AgentUsedCreditSyncService $usedCreditSync,
|
||||
) {}
|
||||
|
||||
/**
|
||||
@@ -36,6 +38,7 @@ final class AgentDashboardOverviewBuilder
|
||||
return null;
|
||||
}
|
||||
|
||||
$this->usedCreditSync->syncForAgentId((int) $node->id);
|
||||
$profile = AgentProfile::query()->where('agent_node_id', $node->id)->first();
|
||||
$subtreeIds = AgentNode::query()
|
||||
->where('path', 'like', $node->path.'%')
|
||||
|
||||
Reference in New Issue
Block a user