diff --git a/modules/EcommerceFinance/View/FinanceLedgerPageData.php b/modules/EcommerceFinance/View/FinanceLedgerPageData.php index e52693fb..638768db 100644 --- a/modules/EcommerceFinance/View/FinanceLedgerPageData.php +++ b/modules/EcommerceFinance/View/FinanceLedgerPageData.php @@ -92,7 +92,7 @@ class FinanceLedgerPageData ? $requestedFlowView : 'summary'; $requestedAccountView = trim((string) request('accounts_view', 'all')); - $accountView = in_array($requestedAccountView, ['all', 'bank', 'non_store'], true) + $accountView = in_array($requestedAccountView, ['all', 'bank', 'non_store', 'wangshang'], true) ? $requestedAccountView : 'all'; $flowPeriod = $this->dateRange('flows'); @@ -166,7 +166,7 @@ class FinanceLedgerPageData $this->db()->table('fin_accounts as a'), 'a.account_short', ); - $this->applyAccountCategoryScope($query, $view, 'a.account_short', 'a.account_type'); + $this->applyAccountCategoryScope($query, $view, 'a.account_short', 'a.account_type', true); $keyword = trim((string) request('accounts_q', '')); if ($keyword !== '') { $query->where(function (Builder $builder) use ($keyword): void { @@ -620,6 +620,7 @@ class FinanceLedgerPageData string $view, string $accountShortColumn, string $accountTypeColumn, + bool $separateWangshangBank = false, ): void { if ($view === 'bank') { $query->where(function (Builder $scope) use ($accountShortColumn, $accountTypeColumn): void { @@ -631,11 +632,27 @@ class FinanceLedgerPageData ->orWhere($accountTypeColumn, 'not like', '%支付宝%'); }); }); + if ($separateWangshangBank) { + $query->where(function (Builder $scope) use ($accountShortColumn, $accountTypeColumn): void { + $scope->where(function (Builder $account) use ($accountShortColumn): void { + $account->whereNull($accountShortColumn) + ->orWhere($accountShortColumn, 'not like', '%网商%'); + })->where(function (Builder $accountType) use ($accountTypeColumn): void { + $accountType->whereNull($accountTypeColumn) + ->orWhere($accountTypeColumn, 'not like', '%网商%'); + }); + }); + } } elseif ($view === 'non_store') { $query->where(function (Builder $scope) use ($accountShortColumn, $accountTypeColumn): void { $scope->where($accountShortColumn, 'like', '%支付宝%') ->orWhere($accountTypeColumn, 'like', '%支付宝%'); }); + } elseif ($view === 'wangshang') { + $query->where(function (Builder $scope) use ($accountShortColumn, $accountTypeColumn): void { + $scope->where($accountShortColumn, 'like', '%网商%') + ->orWhere($accountTypeColumn, 'like', '%网商%'); + }); } } diff --git a/resources/views/business/pages/financial-ledger/ledger.blade.php b/resources/views/business/pages/financial-ledger/ledger.blade.php index 8b55a3cf..db7424b5 100644 --- a/resources/views/business/pages/financial-ledger/ledger.blade.php +++ b/resources/views/business/pages/financial-ledger/ledger.blade.php @@ -710,7 +710,8 @@ @if ($canEditAccounts) @@ -1090,7 +1091,7 @@