PlatformOrder views: use model orderTypeLabel mapping

This commit is contained in:
萝卜
2026-03-15 01:43:50 +00:00
parent c81c5a1f39
commit 6bb3c843dd
3 changed files with 8 additions and 5 deletions

View File

@@ -78,7 +78,8 @@ class PlatformOrderController extends Controller
'plans' => $plans,
'siteSubscription' => $siteSubscription,
'billingCycleLabels' => $this->billingCycleLabels(),
'orderTypeLabels' => $this->orderTypeLabels(),
// order_type label 映射已下沉到 PlatformOrder::orderTypeLabel();这里不再透传 orderTypeLabels
// 'orderTypeLabels' => $this->orderTypeLabels(),
'defaults' => $defaults,
]);
}
@@ -335,7 +336,8 @@ class PlatformOrderController extends Controller
->values(),
'statusLabels' => $this->statusLabels(),
'paymentStatusLabels' => $this->paymentStatusLabels(),
'orderTypeLabels' => $this->orderTypeLabels(),
// order_type label 映射已下沉到 PlatformOrder::orderTypeLabel();这里不再透传 orderTypeLabels
// 'orderTypeLabels' => $this->orderTypeLabels(),
'summaryStats' => [
'total_orders' => (clone $baseQuery)->count(),
'paid_orders' => (clone $baseQuery)->where('payment_status', 'paid')->count(),
@@ -462,7 +464,8 @@ class PlatformOrderController extends Controller
'order' => $order,
'statusLabels' => $this->statusLabels(),
'paymentStatusLabels' => $this->paymentStatusLabels(),
'orderTypeLabels' => $this->orderTypeLabels(),
// order_type label 映射已下沉到 PlatformOrder::orderTypeLabel();这里不再透传 orderTypeLabels
// 'orderTypeLabels' => $this->orderTypeLabels(),
]);
}

View File

@@ -1126,7 +1126,7 @@
@endif
</td>
<td class="col-optional">
{{ $orderTypeLabels[$order->order_type] ?? $order->order_type }}
{{ $order->orderTypeLabel() }}
<div class="muted muted-xs">{{ $order->order_type }}</div>
</td>
<td>

View File

@@ -94,7 +94,7 @@
</tr>
<tr>
<th>订单类型</th>
<td>{{ $orderTypeLabels[$order->order_type] ?? $order->order_type }} <span class="muted">({{ $order->order_type }})</span></td>
<td>{{ $order->orderTypeLabel() }} <span class="muted">({{ $order->order_type }})</span></td>
</tr>
<tr><th>订单状态</th><td>{{ $statusLabels[$order->status] ?? $order->status }} <span class="muted">({{ $order->status }})</span></td></tr>
<tr><th>支付状态</th><td>{{ $paymentStatusLabels[$order->payment_status] ?? $order->payment_status }} <span class="muted">({{ $order->payment_status }})</span></td></tr>