From fc79c99fd103ad2275f66493a49b5c4f489bc9e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Tue, 17 Mar 2026 02:15:26 +0800 Subject: [PATCH] =?UTF-8?q?Dashboard:=20add=20platform=20order=20funnel=20?= =?UTF-8?q?mini=20bars=20(unpaid=E2=86=92pending=E2=86=92syncable)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/admin/dashboard.blade.php | 38 +++++++++++++++++++ ...ormOrderFunnelMiniBarsShouldRenderTest.php | 36 ++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 tests/Feature/AdminDashboardPlatformOrderFunnelMiniBarsShouldRenderTest.php diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php index 9b3b8c8..8aa8943 100644 --- a/resources/views/admin/dashboard.blade.php +++ b/resources/views/admin/dashboard.blade.php @@ -283,6 +283,44 @@ $poRenewalMissingPct = $poTotal > 0 ? min(100, max(0, round(($poRenewalMissing / $poTotal) * 100, 1))) : 0; @endphp + @php + $poUnpaidPending = (int) ($stats['platform_orders_unpaid_pending'] ?? 0); + $poPaidPending = (int) ($stats['platform_orders_paid_pending'] ?? 0); + $poSyncable = (int) ($stats['platform_orders_syncable'] ?? 0); + + $poUnpaidPendingPct = $poTotal > 0 ? min(100, max(0, round(($poUnpaidPending / $poTotal) * 100, 1))) : 0; + $poPaidPendingPct = $poTotal > 0 ? min(100, max(0, round(($poPaidPending / $poTotal) * 100, 1))) : 0; + $poSyncablePct = $poTotal > 0 ? min(100, max(0, round(($poSyncable / $poTotal) * 100, 1))) : 0; + @endphp + +
+
收费主链漏斗(相对平台订单总量 {{ $poTotal }})
+ +
+
待支付
+
+ +
+
{{ $poUnpaidPendingPct }}%
+
+ +
+
待生效
+
+ +
+
{{ $poPaidPendingPct }}%
+
+ +
+
可同步
+
+ +
+
{{ $poSyncablePct }}%
+
+
+
治理风险占比(相对平台订单总量 {{ $poTotal }})
diff --git a/tests/Feature/AdminDashboardPlatformOrderFunnelMiniBarsShouldRenderTest.php b/tests/Feature/AdminDashboardPlatformOrderFunnelMiniBarsShouldRenderTest.php new file mode 100644 index 0000000..f94820a --- /dev/null +++ b/tests/Feature/AdminDashboardPlatformOrderFunnelMiniBarsShouldRenderTest.php @@ -0,0 +1,36 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_dashboard_should_render_platform_order_funnel_mini_bars(): void + { + $this->loginAsPlatformAdmin(); + + $res = $this->get('/admin'); + $res->assertOk(); + + $html = (string) $res->getContent(); + + $this->assertStringContainsString('data-role="dashboard-po-funnel-bars"', $html); + $this->assertStringContainsString('data-role="dashboard-po-unpaid-pending-bar"', $html); + $this->assertStringContainsString('data-role="dashboard-po-paid-pending-bar"', $html); + $this->assertStringContainsString('data-role="dashboard-po-syncable-bar"', $html); + } +}