平台订单列表:锁定订阅ID时显示上下文提示

This commit is contained in:
萝卜
2026-03-13 23:33:44 +00:00
parent 36e7fa6c40
commit 8841238fb6
3 changed files with 84 additions and 0 deletions

View File

@@ -182,6 +182,13 @@ class PlatformOrderController extends Controller
->paginate(10)
->withQueryString();
// 当前列表若锁定了订阅ID则加载该订阅用于“上下文提示/快捷续费下单”等运营入口
$currentSubscription = null;
$currentSubscriptionId = (int) ($filters['site_subscription_id'] ?? 0);
if ($currentSubscriptionId > 0) {
$currentSubscription = SiteSubscription::query()->with(['merchant', 'plan'])->find($currentSubscriptionId);
}
// 列表行级对账视图:回执总额 / 差额(便于运营快速定位问题订单)
$orders->getCollection()->transform(function (PlatformOrder $o) {
$receiptTotal = (float) $this->receiptTotalForOrder($o);
@@ -258,6 +265,7 @@ class PlatformOrderController extends Controller
$totalPaidAmount = (float) ((clone $baseQuery)->sum('paid_amount') ?: 0);
return view('admin.platform_orders.index', [
'currentSubscription' => $currentSubscription,
'orders' => $orders,
'filters' => $filters,
'filterOptions' => [