platform orders: show bmpa error message in row and link to filter

This commit is contained in:
萝卜
2026-03-13 13:31:43 +00:00
parent 50a210ecd8
commit 372f78b4d1
2 changed files with 105 additions and 9 deletions

View File

@@ -771,17 +771,41 @@
@php
$syncErrMsg = (string) (data_get($order->meta, 'subscription_activation_error.message') ?? '');
$syncErrTooLong = $syncErrMsg !== '' && mb_strlen($syncErrMsg) > $SYNC_ERROR_KEYWORD_LINK_MAX_LEN;
$bmpaErrMsg = (string) (data_get($order->meta, 'batch_mark_paid_and_activate_error.message') ?? '');
$bmpaErrTooLong = $bmpaErrMsg !== '' && mb_strlen($bmpaErrMsg) > $SYNC_ERROR_KEYWORD_LINK_MAX_LEN;
$hasAnyErr = ($syncErrMsg !== '') || ($bmpaErrMsg !== '');
@endphp
@if($syncErrMsg !== '')
@if($syncErrTooLong)
<span class="muted text-danger" title="{{ $syncErrMsg }}">{{ mb_substr($syncErrMsg, 0, $SYNC_FAILED_REASON_TRUNCATE_LEN) }}</span>
<div class="muted text-danger muted-xs">原因过长,请复制到筛选框</div>
<a class="link" href="{{ request()->fullUrlWithQuery(['sync_status' => 'failed', 'page' => null]) }}">进入同步失败集合</a>
@else
<a class="link text-danger" href="{!! request()->fullUrlWithQuery(['sync_error_keyword' => $syncErrMsg, 'sync_status' => 'failed', 'page' => null]) !!}">{{ mb_substr($syncErrMsg, 0, $SYNC_FAILED_REASON_TRUNCATE_LEN) }}</a>
@endif
@else
@if(! $hasAnyErr)
<span class="muted">-</span>
@else
@if($syncErrMsg !== '')
<div>
<span class="muted muted-xs">同步:</span>
@if($syncErrTooLong)
<span class="muted text-danger" title="{{ $syncErrMsg }}">{{ mb_substr($syncErrMsg, 0, $SYNC_FAILED_REASON_TRUNCATE_LEN) }}</span>
<div class="muted text-danger muted-xs">原因过长,请复制到筛选框</div>
<a class="link" href="{{ request()->fullUrlWithQuery(['sync_status' => 'failed', 'page' => null]) }}">进入同步失败集合</a>
@else
<a class="link text-danger" href="{!! request()->fullUrlWithQuery(['sync_error_keyword' => $syncErrMsg, 'sync_status' => 'failed', 'page' => null]) !!}">{{ mb_substr($syncErrMsg, 0, $SYNC_FAILED_REASON_TRUNCATE_LEN) }}</a>
@endif
</div>
@endif
@if($bmpaErrMsg !== '')
<div class="mt-6">
<span class="muted muted-xs">BMPA</span>
@if($bmpaErrTooLong)
<span class="muted text-danger" title="{{ $bmpaErrMsg }}">{{ mb_substr($bmpaErrMsg, 0, $SYNC_FAILED_REASON_TRUNCATE_LEN) }}</span>
<div class="muted text-danger muted-xs">原因过长,请复制到筛选框</div>
<a class="link" href="{{ request()->fullUrlWithQuery(['bmpa_failed_only' => '1', 'page' => null]) }}">进入批量标记支付失败集合</a>
@else
<a class="link text-danger" href="{!! request()->fullUrlWithQuery(['bmpa_error_keyword' => $bmpaErrMsg, 'page' => null]) !!}">{{ mb_substr($bmpaErrMsg, 0, $SYNC_FAILED_REASON_TRUNCATE_LEN) }}</a>
@endif
</div>
@endif
@endif
</td>
<td>