chore(admin-ui): hide renew tool link in expiry view

This commit is contained in:
萝卜
2026-03-16 10:05:19 +08:00
parent 50fb0486e0
commit e0b1a707fb
3 changed files with 10 additions and 3 deletions

View File

@@ -261,11 +261,16 @@
}
$createOrderFromSubIndexUrl = \App\Support\BackUrl::withBack('/admin/platform-orders/create?' . \Illuminate\Support\Arr::query($q), $selfWithoutBack);
@endphp
<a class="btn btn-sm" href="{!! $createOrderFromSubIndexUrl !!}">续费下单(先选订阅)</a>
@if(!($isExpiryView ?? false))
<a class="btn btn-sm" href="{!! $createOrderFromSubIndexUrl !!}">续费下单(先选订阅)</a>
@endif
</div>
<div class="muted muted-xs mt-6">
用于运营从订阅目录快速发起续费下单:会把当前 merchant_id/plan_id 作为默认值带到下单页。
<span class="muted">续费单必须绑定订阅,建议从下方列表行内「续费下单」选择具体订阅。</span>
@if(($isExpiryView ?? false))
<span class="muted">(已处于到期集合视图:请优先使用上方「创建续费订单(当前集合)」入口)</span>
@endif
</div>
</div>

View File

@@ -94,8 +94,8 @@ class AdminSiteSubscriptionIndexCreateRenewalOrderLinkTest extends TestCase
}
}
$this->assertTrue($found, '未找到包含当前筛选条件与 back 的创建续费单链接');
$res->assertSee('创建续费单(带当前筛选', false);
$this->assertTrue($found, '未找到包含当前筛选条件与 back 的续费单链接');
$res->assertSee('续费单(先选订阅', false);
// 防 back 嵌套
$res->assertDontSee('back%3D', false);

View File

@@ -27,6 +27,8 @@ class AdminSiteSubscriptionIndexExpiryGovernanceRenewalCtaTest extends TestCase
$res->assertOk();
$res->assertSee('创建续费订单(当前集合)');
// 去重降噪:到期集合视图已有专用 CTA此处不应再出现“续费下单先选订阅”工具入口
$res->assertDontSee('续费下单(先选订阅)');
// CTA 应带上当前筛选 merchant_id/plan_id并且 back 回到当前列表selfWithoutBack
$res->assertSee('href="/admin/platform-orders/create?order_type=renewal&require_subscription=1&merchant_id=2&plan_id=3&back=%2Fadmin%2Fsite-subscriptions%3Fexpiry%3Dexpiring_7d%26merchant_id%3D2%26plan_id%3D3"', false);