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