feat(admin): 仪表盘可同步入口显示计数(口径对齐平台订单)
This commit is contained in:
@@ -58,6 +58,17 @@ class DashboardController extends Controller
|
||||
// 口径对齐“待生效”语义:排除明确的同步失败(失败单应该去同步失败治理)
|
||||
->whereRaw("JSON_EXTRACT(meta, '$.subscription_activation_error.message') IS NULL")
|
||||
->count(),
|
||||
// 可同步:沿用平台订单列表口径(paid+activated+未同步+无失败),且排除续费缺订阅脏数据
|
||||
'platform_orders_syncable' => PlatformOrder::query()
|
||||
->where('payment_status', 'paid')
|
||||
->where('status', 'activated')
|
||||
->whereRaw("JSON_EXTRACT(meta, '$.subscription_activation.subscription_id') IS NULL")
|
||||
->whereRaw("JSON_EXTRACT(meta, '$.subscription_activation_error.message') IS NULL")
|
||||
->where(function ($q) {
|
||||
$q->where('order_type', '!=', 'renewal')
|
||||
->orWhereNotNull('site_subscription_id');
|
||||
})
|
||||
->count(),
|
||||
// 同步失败:沿用平台订单列表口径(meta.subscription_activation_error.message 存在即失败)
|
||||
'platform_orders_sync_failed' => PlatformOrder::query()
|
||||
->whereRaw("JSON_EXTRACT(meta, '$.subscription_activation_error.message') IS NOT NULL")
|
||||
|
||||
Reference in New Issue
Block a user