dashboard: add quick links for BMPA failed and paid-no-receipt orders

This commit is contained in:
萝卜
2026-03-15 23:43:39 +08:00
parent e92636dd5b
commit 27753acb71
3 changed files with 96 additions and 0 deletions

View File

@@ -77,6 +77,16 @@ class DashboardController extends Controller
->where('order_type', 'renewal')
->whereNull('site_subscription_id')
->count(),
// BMPA 失败:用于运营快速定位“批量标记支付并生效”失败的订单集合
'platform_orders_bmpa_failed' => PlatformOrder::query()
->whereRaw("JSON_EXTRACT(meta, '$.batch_mark_paid_and_activate_error.message') IS NOT NULL")
->count(),
// 无回执(已支付但缺少回执证据):用于治理“已付但无回执”的风险订单
'platform_orders_paid_no_receipt' => PlatformOrder::query()
->where('payment_status', 'paid')
->whereRaw("JSON_EXTRACT(meta, '$.payment_summary.total_amount') IS NULL")
->whereRaw("JSON_EXTRACT(meta, '$.payment_receipts[0].amount') IS NULL")
->count(),
// 站点治理
'active_merchants' => Merchant::query()->where('status', 'active')->count(),