From 0f7f72be7147e60fc6d742c7dc1f5cb2e2e472ce Mon Sep 17 00:00:00 2001 From: yueyang <2495544247@qq.com> Date: Fri, 9 Oct 2026 11:19:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A6=E5=8D=95=E6=98=8E=E7=BB=86=E8=81=94?= =?UTF-8?q?=E5=8A=A8=EF=BC=9A=E8=A1=8C=E6=95=B0=E4=B8=BA0=E7=9A=84?= =?UTF-8?q?=E5=8F=96=E5=80=BC=E4=B8=8D=E5=B1=95=E7=A4=BA=EF=BC=8C=E8=81=94?= =?UTF-8?q?=E5=8A=A8=E7=BB=93=E6=9E=9C=E7=BC=93=E5=AD=98=E6=94=BE=E5=AE=BD?= =?UTF-8?q?=E5=88=B05=E5=88=86=E9=92=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EcommerceFinance/View/BillingDetailsPageData.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/EcommerceFinance/View/BillingDetailsPageData.php b/modules/EcommerceFinance/View/BillingDetailsPageData.php index 815740b6..8e13eb87 100644 --- a/modules/EcommerceFinance/View/BillingDetailsPageData.php +++ b/modules/EcommerceFinance/View/BillingDetailsPageData.php @@ -342,7 +342,7 @@ class BillingDetailsPageData try { return cache()->remember( 'billing-details-facets-v1:' . $signature, - now()->addSeconds(60), + now()->addMinutes(5), fn (): array => $this->computeFacets($filters), ); } catch (Throwable $exception) { @@ -648,11 +648,17 @@ class BillingDetailsPageData { $values = []; foreach ($order as $value) { - if (isset($counts[$value])) { + if (($counts[$value] ?? 0) > 0) { $values[] = $value; } } - $rest = array_values(array_diff(array_keys($counts), $values)); + // 行数为 0 的取值不展示(当前已勾选的会由前端补回列表,方便取消) + $rest = []; + foreach ($counts as $value => $count) { + if ($count > 0 && ! in_array($value, $values, true)) { + $rest[] = $value; + } + } sort($rest, SORT_NATURAL | SORT_FLAG_CASE); $values = array_merge($values, $rest);