fix(admin-dashboard): paid_pending count aligns with unsynced scope

This commit is contained in:
萝卜
2026-03-16 19:23:42 +08:00
parent 7c318ef59c
commit 763c706cf3
2 changed files with 22 additions and 2 deletions

View File

@@ -55,7 +55,8 @@ class DashboardController extends Controller
'platform_orders_paid_pending' => PlatformOrder::query()
->where('payment_status', 'paid')
->where('status', 'pending')
// 口径对齐“待生效”语义:排除明确的同步失败(失败单应该去同步失败治理)
// 口径对齐“待生效”语义sync_status=unsynced未同步 + 非失败
->whereRaw("JSON_EXTRACT(meta, '$.subscription_activation.subscription_id') IS NULL")
->whereRaw("JSON_EXTRACT(meta, '$.subscription_activation_error.message') IS NULL")
->count(),
// 可同步沿用平台订单列表口径paid+activated+未同步+无失败),且排除续费缺订阅脏数据