From 0bb97cc6beb25630f18397741c3b1539d0578e8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Sun, 15 Mar 2026 07:35:29 +0000 Subject: [PATCH] =?UTF-8?q?feat(admin):=20=E7=BA=BF=E7=B4=A2/=E8=AE=A2?= =?UTF-8?q?=E9=98=85=E9=94=81=E5=AE=9A=E5=9C=BA=E6=99=AF=E8=A1=A5=E9=BD=90?= =?UTF-8?q?=E7=BB=AD=E8=B4=B9=E7=BC=BA=E8=AE=A2=E9=98=85=E6=B2=BB=E7=90=86?= =?UTF-8?q?=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/platform_orders/index.blade.php | 10 ++++ ...dIncludeRenewalMissingSubscriptionTest.php | 52 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 tests/Feature/AdminPlatformOrderIndexLeadLockGovernanceLinksShouldIncludeRenewalMissingSubscriptionTest.php diff --git a/resources/views/admin/platform_orders/index.blade.php b/resources/views/admin/platform_orders/index.blade.php index d387135..b091caa 100644 --- a/resources/views/admin/platform_orders/index.blade.php +++ b/resources/views/admin/platform_orders/index.blade.php @@ -113,6 +113,10 @@ 'sync_status' => 'failed', 'syncable_only' => null, ]); + + $leadRenewalMissingSubscriptionUrl = $buildLeadGovernUrl([ + 'renewal_missing_subscription' => '1', + ]); @endphp
查看待支付(该线索) @@ -120,6 +124,7 @@ 查看可BMPA处理(该线索) 查看可同步(该线索) 查看同步失败(该线索) + 查看续费缺订阅(该线索)
@@ -212,12 +217,17 @@ 'sync_status' => null, 'fail_only' => null, ]); + + $subRenewalMissingSubscriptionUrl = $buildSubGovernUrl([ + 'renewal_missing_subscription' => '1', + ]); @endphp
查看可同步(该订阅) 查看同步失败(该订阅) 查看待支付(该订阅) 查看待生效(该订阅) + 查看续费缺订阅(该订阅)
diff --git a/tests/Feature/AdminPlatformOrderIndexLeadLockGovernanceLinksShouldIncludeRenewalMissingSubscriptionTest.php b/tests/Feature/AdminPlatformOrderIndexLeadLockGovernanceLinksShouldIncludeRenewalMissingSubscriptionTest.php new file mode 100644 index 0000000..894987e --- /dev/null +++ b/tests/Feature/AdminPlatformOrderIndexLeadLockGovernanceLinksShouldIncludeRenewalMissingSubscriptionTest.php @@ -0,0 +1,52 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_lead_lock_governance_links_should_include_renewal_missing_subscription(): void + { + $this->loginAsPlatformAdmin(); + + $res = $this->get('/admin/platform-orders?lead_id=12&merchant_id=2&plan_id=3&site_subscription_id=4&back=%2Fadmin%2Fplans&syncable_only=1'); + $res->assertOk(); + + $html = (string) $res->getContent(); + + // 线索治理入口:应出现“查看续费缺订阅(该线索)” + $matched = preg_match('/]+href="([^"]+)"[^>]*>\s*查看续费缺订阅(该线索)\s*<\/a>/u', $html, $m); + $this->assertSame(1, $matched, '未找到线索治理入口:查看续费缺订阅(该线索)'); + + $url = $m[1] ?? ''; + $parts = parse_url($url); + parse_str($parts['query'] ?? '', $q); + + // 应保留上下文(lead/merchant/plan/subscription/back),并覆盖 renewal_missing_subscription + $this->assertSame('12', (string) ($q['lead_id'] ?? '')); + $this->assertSame('2', (string) ($q['merchant_id'] ?? '')); + $this->assertSame('3', (string) ($q['plan_id'] ?? '')); + $this->assertSame('4', (string) ($q['site_subscription_id'] ?? '')); + $this->assertSame('/admin/plans', (string) ($q['back'] ?? '')); + + $this->assertSame('1', (string) ($q['renewal_missing_subscription'] ?? '')); + + // 不应继承工具型开关 + $this->assertArrayNotHasKey('syncable_only', $q); + $this->assertArrayNotHasKey('page', $q); + } +}