refactor(site-subscriptions): hide renew tool link in attach mode

This commit is contained in:
萝卜
2026-03-16 11:25:53 +08:00
parent 22efadd74b
commit bc7300d61b
2 changed files with 8 additions and 1 deletions

View File

@@ -261,7 +261,7 @@
}
$createOrderFromSubIndexUrl = \App\Support\BackUrl::withBack('/admin/platform-orders/create?' . \Illuminate\Support\Arr::query($q), $selfWithoutBack);
@endphp
@if(!($isExpiryView ?? false))
@if(!($isExpiryView ?? false) && $attachOrderId <= 0)
<a class="btn btn-sm" href="{!! $createOrderFromSubIndexUrl !!}">续费下单(先选订阅)</a>
@endif
</div>
@@ -271,6 +271,9 @@
@if(($isExpiryView ?? false))
<span class="muted">(已处于到期集合视图:请优先使用上方「创建续费订单(当前集合)」入口)</span>
@endif
@if($attachOrderId > 0)
<span class="muted">(当前为“绑定订阅到订单”模式:请在列表行内直接点击「绑定到订单」)</span>
@endif
</div>
</div>

View File

@@ -61,6 +61,10 @@ class AdminSiteSubscriptionIndexAttachOrderIdShouldRenderBindButtonTest extends
$res->assertOk();
$html = (string) $res->getContent();
// 去重降噪:处于 attach_order_id 模式时,不应出现“续费下单(先选订阅)”工具入口
$this->assertStringNotContainsString('续费下单(先选订阅)', $html);
$this->assertStringContainsString('绑定到订单 #' . $orderId, $html);
$this->assertStringContainsString('/admin/platform-orders/' . $orderId . '/attach-subscription', $html);
$this->assertStringContainsString('name="site_subscription_id" value="' . $sub->id . '"', $html);