平台订单详情:对账/退款异常时禁用同步订阅并给治理提示块

This commit is contained in:
萝卜
2026-03-14 00:15:25 +00:00
parent 61d50090a6
commit bf39bccbee
2 changed files with 111 additions and 19 deletions

View File

@@ -209,29 +209,37 @@
</div>
@endif
@php
$syncBlockedByGovernance = $order->isReconcileMismatch() || $order->isRefundInconsistent();
@endphp
<form method="post" action="/admin/platform-orders/{{ $order->id }}/activate-subscription" onsubmit="return confirm('确认同步订阅?将根据该订单创建/续期订阅');">
@csrf
<button type="submit" @disabled(! $canActivate || $alreadySynced)>{{ $alreadySynced ? '已同步' : '同步订阅' }}</button>
<button type="submit" @disabled(! $canActivate || $alreadySynced || $syncBlockedByGovernance)>{{ $alreadySynced ? '已同步' : '同步订阅' }}</button>
</form>
@if($order->isReconcileMismatch() || $order->isRefundInconsistent())
<div class="muted text-danger" style="margin-top:6px; width:100%;">
提示:当前订单命中「对账不一致/退款不一致」,为避免带病同步,请先完成金额/状态治理(补回执/核对退款/修正状态)后再同步订阅。
@if($order->isReconcileMismatch())
@php
$fixReceiptUrl = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $orderShowSelf]) . '#add-payment-receipt';
@endphp
<a class="link" href="{!! $fixReceiptUrl !!}">去补回执</a>
@endif
@if($order->isReconcileMismatch() && $order->isRefundInconsistent())
<span class="muted"></span>
@endif
@if($order->isRefundInconsistent())
@php
$fixRefundUrl = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $orderShowSelf]) . '#refund-receipts';
@endphp
<a class="link" href="{!! $fixRefundUrl !!}">去核对退款</a>
@endif
@if($syncBlockedByGovernance)
<div class="card" style="margin-top:10px; width:100%; border:1px solid #f5c2c7; background:#fff5f5;">
<div class="muted text-danger"><strong>同步订阅治理提示</strong>(当前不建议/不可直接同步)</div>
<div class="muted muted-xs" style="margin-top:6px;">
<div>原因:订单命中「对账不一致/退款不一致」。为避免把“带病订单”同步到订阅,请先完成金额/状态治理。</div>
<div style="margin-top:6px;">
@if($order->isReconcileMismatch())
@php
$fixReceiptUrl = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $orderShowSelf]) . '#add-payment-receipt';
@endphp
<a class="link" href="{!! $fixReceiptUrl !!}">去补回执</a>
@endif
@if($order->isReconcileMismatch() && $order->isRefundInconsistent())
<span class="muted"></span>
@endif
@if($order->isRefundInconsistent())
@php
$fixRefundUrl = '/admin/platform-orders/' . $order->id . '?' . \Illuminate\Support\Arr::query(['back' => $orderShowSelf]) . '#refund-receipts';
@endphp
<a class="link" href="{!! $fixRefundUrl !!}">去核对退款</a>
@endif
</div>
</div>
</div>
@endif