From d76a50e37cadba4e9733aa0a905ad5db67c22db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Sun, 15 Mar 2026 00:43:04 +0000 Subject: [PATCH] Admin dashboard: add billing workbench entry and quick links --- resources/views/admin/dashboard.blade.php | 22 ++++++++++ ...dminDashboardBillingWorkbenchLinksTest.php | 39 +++++++++++++++++ ...ashboardBillingWorkbenchQuickLinksTest.php | 43 +++++++++++++++++++ 3 files changed, 104 insertions(+) create mode 100644 tests/Feature/AdminDashboardBillingWorkbenchLinksTest.php create mode 100644 tests/Feature/AdminDashboardBillingWorkbenchQuickLinksTest.php diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php index b6e6100..5444851 100644 --- a/resources/views/admin/dashboard.blade.php +++ b/resources/views/admin/dashboard.blade.php @@ -22,6 +22,28 @@ + +
+

收费工作台

+
聚焦收费闭环的日常治理入口:订单 → 订阅 → 套餐。
+ + + +
+
快捷筛选:
+ +
+
+
站点
{{ $stats['merchants'] }}
管理员
{{ $stats['admins'] }}
diff --git a/tests/Feature/AdminDashboardBillingWorkbenchLinksTest.php b/tests/Feature/AdminDashboardBillingWorkbenchLinksTest.php new file mode 100644 index 0000000..a442334 --- /dev/null +++ b/tests/Feature/AdminDashboardBillingWorkbenchLinksTest.php @@ -0,0 +1,39 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_dashboard_should_render_billing_workbench_links(): void + { + $this->loginAsPlatformAdmin(); + + $res = $this->get('/admin'); + $res->assertOk(); + + $res->assertSee('收费工作台'); + $res->assertSee('href="/admin/platform-orders"', false); + $res->assertSee('进入平台订单'); + + $res->assertSee('href="/admin/site-subscriptions"', false); + $res->assertSee('进入订阅管理'); + + $res->assertSee('href="/admin/plans"', false); + $res->assertSee('进入套餐管理'); + } +} diff --git a/tests/Feature/AdminDashboardBillingWorkbenchQuickLinksTest.php b/tests/Feature/AdminDashboardBillingWorkbenchQuickLinksTest.php new file mode 100644 index 0000000..8e65f0a --- /dev/null +++ b/tests/Feature/AdminDashboardBillingWorkbenchQuickLinksTest.php @@ -0,0 +1,43 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_dashboard_should_render_billing_workbench_quick_links(): void + { + $this->loginAsPlatformAdmin(); + + $res = $this->get('/admin'); + $res->assertOk(); + + $res->assertSee('快捷筛选'); + + $res->assertSee('href="/admin/platform-orders?payment_status=unpaid&status=pending"', false); + $res->assertSee('待支付'); + + $res->assertSee('href="/admin/platform-orders?payment_status=paid&status=pending"', false); + $res->assertSee('待生效'); + + $res->assertSee('href="/admin/platform-orders?syncable_only=1"', false); + $res->assertSee('可同步'); + + $res->assertSee('href="/admin/platform-orders?sync_status=failed"', false); + $res->assertSee('同步失败'); + } +}