admin: 订阅详情页补齐BMPA失败数摘要与直达治理链接

This commit is contained in:
萝卜
2026-03-13 14:56:49 +00:00
parent 7960416aed
commit 2254e00f23
3 changed files with 103 additions and 0 deletions

View File

@@ -92,6 +92,11 @@ class SiteSubscriptionController extends Controller
}
}
// 订阅维度BMPA批量标记支付并生效失败订单数与平台订单列表 bmpa_failed_only 口径一致)
$bmpaFailedOrders = (clone $baseOrdersQuery)
->whereRaw("JSON_EXTRACT(meta, '$.batch_mark_paid_and_activate_error.message') IS NOT NULL")
->count();
$summaryStats = $summaryStats + [
'receipt_orders' => $receiptOrders,
'no_receipt_orders' => $noReceiptOrders,
@@ -103,6 +108,8 @@ class SiteSubscriptionController extends Controller
'refund_inconsistent_orders' => (int) $refundInconsistentOrders,
// 对账不一致订单(订阅维度)
'reconcile_mismatch_orders' => (int) $reconcileMismatchOrders,
// BMPA 失败订单(订阅维度)
'bmpa_failed_orders' => (int) $bmpaFailedOrders,
// 对账差额:回执总额 - 已付总额(订阅维度)
'reconciliation_delta' => (float) ($totalReceiptAmount - (float) $metaOrders->sum('paid_amount')),
];