feat(wallet): 增强资金流水和信用账本的公共类型过滤,支持游戏结算和账单结算
This commit is contained in:
@@ -17,12 +17,15 @@ use App\Support\AgentSettlementPeriodWindow;
|
||||
final class SettlementCenterLedgerService
|
||||
{
|
||||
private const CREDIT_BIZ_TYPES = [
|
||||
'bet',
|
||||
'bet_hold',
|
||||
'game_settlement',
|
||||
'bet_hold_release',
|
||||
'game_settlement_loss',
|
||||
'game_settlement_win',
|
||||
'game_settlement_reversal',
|
||||
'settlement_confirm',
|
||||
'bill_settlement',
|
||||
'settlement_payout',
|
||||
];
|
||||
|
||||
@@ -34,6 +37,12 @@ final class SettlementCenterLedgerService
|
||||
|
||||
private const SHARE_BIZ_TYPE = 'share_ledger';
|
||||
|
||||
private const CREDIT_PUBLIC_BIZ_TYPE_MAP = [
|
||||
'bet' => ['bet_hold'],
|
||||
'game_settlement' => ['bet_hold_release', 'game_settlement_loss', 'game_settlement_win', 'game_settlement_reversal'],
|
||||
'bill_settlement' => ['settlement_confirm', 'settlement_payout'],
|
||||
];
|
||||
|
||||
public function __construct(
|
||||
private readonly SettlementPartyEnrichment $partyEnrichment,
|
||||
private readonly CreditLedgerBetFlowPresenter $betFlowPresenter,
|
||||
@@ -304,7 +313,7 @@ final class SettlementCenterLedgerService
|
||||
}
|
||||
|
||||
if ($filters->bizType !== null && $filters->bizType !== '') {
|
||||
$query->where('cl.reason', $filters->bizType);
|
||||
$query->whereIn('cl.reason', $this->resolveCreditReasonFilter($filters->bizType));
|
||||
} elseif ($filters->betFlowOnly) {
|
||||
$query->whereIn('cl.reason', [
|
||||
'bet_hold',
|
||||
@@ -319,6 +328,14 @@ final class SettlementCenterLedgerService
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
private function resolveCreditReasonFilter(string $bizType): array
|
||||
{
|
||||
return self::CREDIT_PUBLIC_BIZ_TYPE_MAP[$bizType] ?? [$bizType];
|
||||
}
|
||||
|
||||
private function paymentStubQuery(
|
||||
AdminUser $admin,
|
||||
string $siteCode,
|
||||
|
||||
Reference in New Issue
Block a user