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