From a0c3b8a1ff763cf527d52794f51c04c980ed3caf Mon Sep 17 00:00:00 2001 From: kang Date: Tue, 9 Jun 2026 15:13:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=BC=BA=E4=BF=A1=E7=94=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E6=A3=80=E6=9F=A5=EF=BC=8C=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=A3=80=E6=9F=A5=E9=A1=B9=E4=BB=A5=E9=80=82?= =?UTF-8?q?=E5=BA=94=E6=95=B0=E6=8D=AE=E5=BA=93=E7=BB=93=E6=9E=84=E5=8F=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Commands/AuditFinancialChainCommand.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/AuditFinancialChainCommand.php b/app/Console/Commands/AuditFinancialChainCommand.php index 42e7183..5aef0d7 100644 --- a/app/Console/Commands/AuditFinancialChainCommand.php +++ b/app/Console/Commands/AuditFinancialChainCommand.php @@ -4,6 +4,7 @@ namespace App\Console\Commands; use Illuminate\Console\Command; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Schema; final class AuditFinancialChainCommand extends Command { @@ -88,7 +89,7 @@ final class AuditFinancialChainCommand extends Command */ private function creditIssues(): array { - return $this->countIssues([ + $checks = [ 'credit_account_negative' => [ 'message' => '玩家授信账户额度、已用或冻结为负数', 'sql' => 'select count(*) as cnt from player_credit_accounts where credit_limit < 0 or used_credit < 0 or frozen_credit < 0', @@ -113,7 +114,13 @@ final class AuditFinancialChainCommand extends Command 'message' => '信用流水引用了不存在的结算账单', 'sql' => "select count(*) as cnt from credit_ledger cl where cl.ref_type = 'settlement_bill' and not exists (select 1 from settlement_bills sb where sb.id = cl.ref_id)", ], - ]); + ]; + + if (! Schema::hasColumn('players', 'funding_mode')) { + unset($checks['credit_players_without_account']); + } + + return $this->countIssues($checks); } /**