diff --git a/app/Http/Controllers/Admin/DashboardController.php b/app/Http/Controllers/Admin/DashboardController.php index 1eb2b03..dd6dd84 100644 --- a/app/Http/Controllers/Admin/DashboardController.php +++ b/app/Http/Controllers/Admin/DashboardController.php @@ -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") diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php index 81be3cb..d1a2b1b 100644 --- a/resources/views/admin/dashboard.blade.php +++ b/resources/views/admin/dashboard.blade.php @@ -101,7 +101,7 @@