From 3bcad91fd16b9e77621695db0fd1f86f6e71bcb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Wed, 11 Mar 2026 05:50:57 +0000 Subject: [PATCH] =?UTF-8?q?=E5=AE=A1=E8=AE=A1=E8=AE=B0=E5=BD=95=EF=BC=9A?= =?UTF-8?q?=E5=BF=AB=E7=85=A7=E5=88=97=E6=94=B9=E4=B8=BA=E9=80=9A=E7=94=A8?= =?UTF-8?q?=20key=3Dvalue=20=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/platform_orders/show.blade.php | 63 ++++++++++++------- 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/resources/views/admin/platform_orders/show.blade.php b/resources/views/admin/platform_orders/show.blade.php index e8c8d78..6d2eefd 100644 --- a/resources/views/admin/platform_orders/show.blade.php +++ b/resources/views/admin/platform_orders/show.blade.php @@ -440,38 +440,53 @@ @foreach($auditItems as $item) @php $snap = (array) (data_get($item, 'snapshot', []) ?? []); + + // 统一快照展示:优先 paid/refund;剩余字段走 key=value;无 snapshot 则降级展示 subscription_id/filters。 + $pairs = []; + $snapPaid = data_get($snap, 'paid_amount'); $snapRefund = data_get($snap, 'refund_total'); + if ($snapPaid !== null || $snapRefund !== null) { + $pairs[] = 'paid=¥' . number_format((float) ($snapPaid ?? 0), 2); + $pairs[] = 'refund=¥' . number_format((float) ($snapRefund ?? 0), 2); + + // 剩余字段:key=value + foreach ($snap as $k => $v) { + if (in_array((string) $k, ['paid_amount', 'refund_total'], true)) { + continue; + } + + if (is_array($v)) { + $v = json_encode($v, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); + } elseif (is_bool($v)) { + $v = $v ? 'true' : 'false'; + } + + $v = (string) $v; + $v = mb_substr($v, 0, 80); + $pairs[] = (string) $k . '=' . $v; + } + } else { + $subId = data_get($item, 'subscription_id'); + $filtersText = (string) (data_get($item, 'filters') ?? ''); + $filtersText = $filtersText !== '' ? mb_substr($filtersText, 0, 80) : ''; + + if ($subId) { + $pairs[] = 'subscription_id=' . (string) $subId; + } + if ($filtersText !== '') { + $pairs[] = 'filters=' . $filtersText; + } + } + + $snapshotText = count($pairs) > 0 ? implode(';', $pairs) : '-'; @endphp {{ $auditActionLabels[data_get($item, 'action')] ?? (data_get($item, 'action') ?: '-') }} {{ data_get($item, 'scope') ?: '-' }} {{ data_get($item, 'at') ?: '-' }} {{ data_get($item, 'admin_id') ?: '-' }} - - @if($snapPaid !== null || $snapRefund !== null) - paid=¥{{ number_format((float) ($snapPaid ?? 0), 2) }};refund=¥{{ number_format((float) ($snapRefund ?? 0), 2) }} - @else - @php - $subId = data_get($item, 'subscription_id'); - $filtersText = (string) (data_get($item, 'filters') ?? ''); - $filtersText = $filtersText !== '' ? mb_substr($filtersText, 0, 80) : ''; - @endphp - @if($subId || $filtersText !== '') - @if($subId) - subscription_id={{ $subId }} - @endif - @if($subId && $filtersText !== '') - ; - @endif - @if($filtersText !== '') - filters={{ $filtersText }} - @endif - @else - - - @endif - @endif - + {{ $snapshotText }} {{ data_get($item, 'note') ?: '' }} @endforeach