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);