From 7c0d70d49cff9d2909b84063fad761e4eb3d0840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Sat, 14 Mar 2026 04:12:22 +0000 Subject: [PATCH] =?UTF-8?q?feat(admin):=20=E5=B9=B3=E5=8F=B0=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E7=AD=9B=E9=80=89=E5=A2=9E=E5=8A=A0=E7=BA=BF=E7=B4=A2?= =?UTF-8?q?ID=EF=BC=88lead=5Fid=EF=BC=89=E4=B8=8E=E4=B8=8A=E4=B8=8B?= =?UTF-8?q?=E6=96=87=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/platform_orders/index.blade.php | 10 +++++ ...ormOrderIndexLeadIdFilterFormFieldTest.php | 42 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 tests/Feature/AdminPlatformOrderIndexLeadIdFilterFormFieldTest.php diff --git a/resources/views/admin/platform_orders/index.blade.php b/resources/views/admin/platform_orders/index.blade.php index 6d5e452..c38ec02 100644 --- a/resources/views/admin/platform_orders/index.blade.php +++ b/resources/views/admin/platform_orders/index.blade.php @@ -40,7 +40,16 @@ @php $currentSubscription = $currentSubscription ?? null; + $incomingLeadId = (int) request()->query('lead_id', 0); @endphp + + @if($incomingLeadId > 0) +
+ 当前线索:#{{ $incomingLeadId }} + (已按 lead_id 过滤订单集合) +
+ @endif + @if($currentSubscription && $currentSubscription->id)
当前已锁定订阅:
@@ -247,6 +256,7 @@ 只看退款不一致(状态 vs 退款总额) +
diff --git a/tests/Feature/AdminPlatformOrderIndexLeadIdFilterFormFieldTest.php b/tests/Feature/AdminPlatformOrderIndexLeadIdFilterFormFieldTest.php new file mode 100644 index 0000000..642c8ac --- /dev/null +++ b/tests/Feature/AdminPlatformOrderIndexLeadIdFilterFormFieldTest.php @@ -0,0 +1,42 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_index_should_render_lead_id_filter_field(): void + { + $this->loginAsPlatformAdmin(); + + $res = $this->get('/admin/platform-orders'); + $res->assertOk(); + + $res->assertSee('name="lead_id"', false); + $res->assertSee('线索ID', false); + } + + public function test_index_should_render_lead_context_badge_when_filtered(): void + { + $this->loginAsPlatformAdmin(); + + $res = $this->get('/admin/platform-orders?lead_id=12'); + $res->assertOk(); + + $res->assertSee('当前线索:#12', false); + } +}