From f3afa2b3050399109dcf08c52a702dd378b668d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Sun, 15 Mar 2026 08:07:07 +0000 Subject: [PATCH] =?UTF-8?q?feat(admin):=20=E5=A5=97=E9=A4=90=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?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/admin/plans/index.blade.php | 7 +++ ...lMissingSubscriptionGovernanceLinkTest.php | 51 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 tests/Feature/AdminPlanIndexRenewalMissingSubscriptionGovernanceLinkTest.php diff --git a/resources/views/admin/plans/index.blade.php b/resources/views/admin/plans/index.blade.php index 8fc7f0c..5597cf1 100644 --- a/resources/views/admin/plans/index.blade.php +++ b/resources/views/admin/plans/index.blade.php @@ -260,9 +260,16 @@ 'order_type' => 'new_purchase', ]), $selfWithoutBack); @endphp + @php + $renewalMissingSubscriptionUrl = $makePlatformOrderUrl([ + 'plan_id' => $plan->id, + 'renewal_missing_subscription' => '1', + ]); + @endphp
编辑 创建订单 + 续费缺订阅
diff --git a/tests/Feature/AdminPlanIndexRenewalMissingSubscriptionGovernanceLinkTest.php b/tests/Feature/AdminPlanIndexRenewalMissingSubscriptionGovernanceLinkTest.php new file mode 100644 index 0000000..b387956 --- /dev/null +++ b/tests/Feature/AdminPlanIndexRenewalMissingSubscriptionGovernanceLinkTest.php @@ -0,0 +1,51 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_plan_index_should_render_renewal_missing_subscription_governance_link(): void + { + $this->loginAsPlatformAdmin(); + + $plan = Plan::query()->create([ + 'code' => 'plan_index_rms_link_plan', + 'name' => '套餐页续费缺订阅治理入口测试套餐', + 'billing_cycle' => 'monthly', + 'price' => 10, + 'list_price' => 10, + 'status' => 'active', + 'sort' => 10, + 'published_at' => now(), + ]); + + $res = $this->get('/admin/plans'); + $res->assertOk(); + + $html = (string) $res->getContent(); + + // 操作区应出现“续费缺订阅”入口 + $this->assertStringContainsString('续费缺订阅', $html); + + // 链接应带 plan_id + renewal_missing_subscription=1,并携带 back 回套餐页 + $this->assertStringContainsString('/admin/platform-orders?plan_id=' . $plan->id, $html); + $this->assertStringContainsString('renewal_missing_subscription=1', $html); + $this->assertStringContainsString('back=' . urlencode('/admin/plans'), $html); + } +}