diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php index 1e706d0..de93281 100644 --- a/resources/views/admin/dashboard.blade.php +++ b/resources/views/admin/dashboard.blade.php @@ -47,24 +47,33 @@
+ @php + $kpiLinks = [ + 'merchants' => \App\Support\BackUrl::withBack('/admin/merchants', $selfWithoutBack), + 'plans' => \App\Support\BackUrl::withBack('/admin/plans', $selfWithoutBack), + 'site_subscriptions' => \App\Support\BackUrl::withBack('/admin/site-subscriptions', $selfWithoutBack), + 'platform_orders' => \App\Support\BackUrl::withBack('/admin/platform-orders', $selfWithoutBack), + ]; + @endphp +
站点
-
{{ $stats['merchants'] }}
+
全站点数量(总台视角)
套餐
-
{{ (int) ($stats['plans'] ?? 0) }}
+
可售套餐目录
订阅
-
{{ (int) ($stats['site_subscriptions'] ?? 0) }}
+
站点订阅总量(收费主链)
平台订单
-
{{ (int) ($stats['platform_orders'] ?? 0) }}
+
平台收费订单总量
diff --git a/tests/Feature/AdminDashboardKpiCardsShouldLinkToListsWithBackTest.php b/tests/Feature/AdminDashboardKpiCardsShouldLinkToListsWithBackTest.php new file mode 100644 index 0000000..06abf42 --- /dev/null +++ b/tests/Feature/AdminDashboardKpiCardsShouldLinkToListsWithBackTest.php @@ -0,0 +1,36 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_dashboard_kpi_cards_should_link_to_lists_with_back(): void + { + $this->loginAsPlatformAdmin(); + + $res = $this->get('/admin'); + $res->assertOk(); + + $res->assertSee('href="/admin/merchants?back=%2Fadmin"', false); + $res->assertSee('href="/admin/plans?back=%2Fadmin"', false); + $res->assertSee('href="/admin/site-subscriptions?back=%2Fadmin"', false); + $res->assertSee('href="/admin/platform-orders?back=%2Fadmin"', false); + + $res->assertDontSee('&back=', false); + } +}