From 4592d4afeb07c72db054c1a62fc67fe2b4264f0c Mon Sep 17 00:00:00 2001
From: shanshi <3316401569@qq.com>
Date: Wed, 11 Nov 2026 19:23:45 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8B=86=E5=88=86=E6=94=AF=E4=BB=98?=
=?UTF-8?q?=E5=AE=9D=E4=B8=8E=E7=BD=91=E5=95=86=E9=93=B6=E8=A1=8C=E8=B4=A6?=
=?UTF-8?q?=E6=88=B7=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../View/FinanceLedgerPageData.php | 21 +++++++++++++++++--
.../pages/financial-ledger/ledger.blade.php | 5 +++--
.../FinanceLedgerHeaderControlsTest.php | 19 ++++++++++++++---
3 files changed, 38 insertions(+), 7 deletions(-)
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)