From d28885db503d7963970c2cae4651201fe2f82fca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Sun, 15 Mar 2026 08:09:25 +0000 Subject: [PATCH] =?UTF-8?q?feat(admin):=20=E7=BA=BF=E7=B4=A2=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E8=A1=A5=E9=BD=90=E7=BB=AD=E8=B4=B9=E7=BC=BA=E8=AE=A2?= =?UTF-8?q?=E9=98=85=E6=B2=BB=E7=90=86=E5=85=A5=E5=8F=A3=EF=BC=88=E6=8C=89?= =?UTF-8?q?=20lead=5Fid=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/platform_leads/index.blade.php | 7 +++ ...lMissingSubscriptionGovernanceLinkTest.php | 61 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 tests/Feature/AdminPlatformLeadIndexShouldIncludeRenewalMissingSubscriptionGovernanceLinkTest.php diff --git a/resources/views/admin/platform_leads/index.blade.php b/resources/views/admin/platform_leads/index.blade.php index aa7d4c2..85a9cd5 100644 --- a/resources/views/admin/platform_leads/index.blade.php +++ b/resources/views/admin/platform_leads/index.blade.php @@ -161,8 +161,15 @@ 'lead_id' => $l->id, 'back' => $selfWithoutBack, ]); + + $viewRenewalMissingSubOrdersUrl = '/admin/platform-orders?' . \Illuminate\Support\Arr::query([ + 'lead_id' => $l->id, + 'renewal_missing_subscription' => '1', + 'back' => $selfWithoutBack, + ]); @endphp 查看订单 + 续费缺订阅 diff --git a/tests/Feature/AdminPlatformLeadIndexShouldIncludeRenewalMissingSubscriptionGovernanceLinkTest.php b/tests/Feature/AdminPlatformLeadIndexShouldIncludeRenewalMissingSubscriptionGovernanceLinkTest.php new file mode 100644 index 0000000..f90deb3 --- /dev/null +++ b/tests/Feature/AdminPlatformLeadIndexShouldIncludeRenewalMissingSubscriptionGovernanceLinkTest.php @@ -0,0 +1,61 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_platform_lead_index_should_include_renewal_missing_subscription_governance_link(): void + { + $this->loginAsPlatformAdmin(); + + $plan = Plan::query()->create([ + 'code' => 'lead_index_rms_link_plan', + 'name' => '线索页续费缺订阅治理入口测试套餐', + 'billing_cycle' => 'monthly', + 'price' => 10, + 'list_price' => 10, + 'status' => 'active', + 'sort' => 10, + 'published_at' => now(), + ]); + + $lead = PlatformLead::query()->create([ + 'status' => 'new', + 'name' => '张三', + 'mobile' => '13800000000', + 'email' => 'zs@example.com', + 'company' => '测试公司', + 'plan_id' => $plan->id, + 'source' => 'test', + 'meta' => [], + ]); + + $res = $this->get('/admin/platform-leads'); + $res->assertOk(); + + $html = (string) $res->getContent(); + + // 应出现“续费缺订阅”按钮,并携带 lead_id + renewal_missing_subscription=1 + back 回线索页 + $this->assertStringContainsString('续费缺订阅', $html); + $this->assertStringContainsString('/admin/platform-orders?lead_id=' . $lead->id, $html); + $this->assertStringContainsString('renewal_missing_subscription=1', $html); + $this->assertStringContainsString('back=' . urlencode('/admin/platform-leads'), $html); + } +}