From 4a3e6942e698f83fdd293b5de490b2e234f93645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Sun, 15 Mar 2026 19:18:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(admin):=20=E4=BB=AA=E8=A1=A8=E7=9B=98?= =?UTF-8?q?=E5=8D=A0=E6=AF=94=E5=8D=A1=E5=A5=97=E9=A4=90=E5=90=8D=E5=8F=AF?= =?UTF-8?q?=E8=B7=B3=E5=B9=B3=E5=8F=B0=E8=AE=A2=E5=8D=95=E5=B9=B6=E5=9B=9E?= =?UTF-8?q?=E8=B7=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/admin/dashboard.blade.php | 8 ++++- ...nOrderSharePlanLinkShouldCarryBackTest.php | 33 +++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 tests/Feature/AdminDashboardPlanOrderSharePlanLinkShouldCarryBackTest.php diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php index b0f8e25..7d64c99 100644 --- a/resources/views/admin/dashboard.blade.php +++ b/resources/views/admin/dashboard.blade.php @@ -183,8 +183,14 @@ $pct = $totalOrders > 0 ? round(($count / $totalOrders) * 100, 1) : 0; $planName = (string) (($planIdToName[$planId] ?? '') ?: ('#' . $planId)); @endphp + @php + $planOrdersUrl = \App\Support\BackUrl::withBack( + '/admin/platform-orders?' . \Illuminate\Support\Arr::query(['plan_id' => $planId]), + $selfWithoutBack + ); + @endphp - {{ $planName }} + {{ $planName }} {{ $count }} {{ $pct }}% diff --git a/tests/Feature/AdminDashboardPlanOrderSharePlanLinkShouldCarryBackTest.php b/tests/Feature/AdminDashboardPlanOrderSharePlanLinkShouldCarryBackTest.php new file mode 100644 index 0000000..c1291a3 --- /dev/null +++ b/tests/Feature/AdminDashboardPlanOrderSharePlanLinkShouldCarryBackTest.php @@ -0,0 +1,33 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_dashboard_plan_order_share_plan_link_should_carry_back(): void + { + $this->loginAsPlatformAdmin(); + + $res = $this->get('/admin'); + $res->assertOk(); + + // 套餐占比表格里,点击套餐名应跳到平台订单列表并带 back 回到仪表盘 + $res->assertSee('href="/admin/platform-orders?plan_id=1&back=%2Fadmin"', false); + $res->assertDontSee('&back=', false); + } +}