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