From 0a5b86ac559802ec99491c1924a5b27239f78bbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Sun, 15 Mar 2026 19:46:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(admin):=20=E4=BB=AA=E8=A1=A8=E7=9B=98?= =?UTF-8?q?=E5=BE=85=E7=94=9F=E6=95=88=E8=AE=A1=E6=95=B0=E6=8E=92=E9=99=A4?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=A4=B1=E8=B4=A5=EF=BC=88=E5=8F=A3=E5=BE=84?= =?UTF-8?q?=E6=9B=B4=E6=B8=85=E6=99=B0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Admin/DashboardController.php | 2 ++ ...ashboardBillingWorkbenchQuickLinksShouldShowCountsTest.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Admin/DashboardController.php b/app/Http/Controllers/Admin/DashboardController.php index ec3a919..1eb2b03 100644 --- a/app/Http/Controllers/Admin/DashboardController.php +++ b/app/Http/Controllers/Admin/DashboardController.php @@ -55,6 +55,8 @@ class DashboardController extends Controller 'platform_orders_paid_pending' => PlatformOrder::query() ->where('payment_status', 'paid') ->where('status', 'pending') + // 口径对齐“待生效”语义:排除明确的同步失败(失败单应该去同步失败治理) + ->whereRaw("JSON_EXTRACT(meta, '$.subscription_activation_error.message') IS NULL") ->count(), // 同步失败:沿用平台订单列表口径(meta.subscription_activation_error.message 存在即失败) 'platform_orders_sync_failed' => PlatformOrder::query() diff --git a/tests/Feature/AdminDashboardBillingWorkbenchQuickLinksShouldShowCountsTest.php b/tests/Feature/AdminDashboardBillingWorkbenchQuickLinksShouldShowCountsTest.php index b24b7b5..0aa4b7e 100644 --- a/tests/Feature/AdminDashboardBillingWorkbenchQuickLinksShouldShowCountsTest.php +++ b/tests/Feature/AdminDashboardBillingWorkbenchQuickLinksShouldShowCountsTest.php @@ -86,9 +86,9 @@ class AdminDashboardBillingWorkbenchQuickLinksShouldShowCountsTest extends TestC $res = $this->get('/admin'); $res->assertOk(); - // paid_pending 的定义是 paid + pending,其中包含 sync_failed 那一条,因此预期为 2 + // 待生效口径:paid + pending,但排除“同步失败”(失败应在同步失败集合处理) $res->assertSee('待支付(1)'); - $res->assertSee('待生效(2)'); + $res->assertSee('待生效(1)'); $res->assertSee('同步失败(1)'); } }