diff --git a/app/Http/Controllers/Admin/PlatformOrderController.php b/app/Http/Controllers/Admin/PlatformOrderController.php index 83218bd..50245cd 100644 --- a/app/Http/Controllers/Admin/PlatformOrderController.php +++ b/app/Http/Controllers/Admin/PlatformOrderController.php @@ -255,6 +255,8 @@ class PlatformOrderController extends Controller 'bmpa_error_keyword' => trim((string) $request->query('bmpa_error_keyword', '')), // 只看“可同步订阅”的订单:已支付 + 已生效 + 未同步(用于运营快速处理) 'syncable_only' => (string) $request->query('syncable_only', ''), + // 只看“续费但未绑定订阅”的脏数据(可治理) + 'renewal_missing_subscription' => (string) $request->query('renewal_missing_subscription', ''), // 只看最近 24 小时批量同步过的订单(可治理追踪) 'batch_synced_24h' => (string) $request->query('batch_synced_24h', ''), // 只看最近 24 小时批量“标记支付并生效(BMPA)”过的订单(可治理追踪) @@ -420,6 +422,10 @@ class PlatformOrderController extends Controller ->orWhereNotNull('site_subscription_id'); }) ->count(), + 'renewal_missing_subscription_orders' => (clone $baseQuery) + ->where('order_type', 'renewal') + ->whereNull('site_subscription_id') + ->count(), 'batch_synced_24h_orders' => (function () use ($baseQuery) { $since = now()->subHours(24)->format('Y-m-d H:i:s'); @@ -2112,6 +2118,11 @@ class PlatformOrderController extends Controller ->orWhereNotNull('site_subscription_id'); }); }) + ->when(($filters['renewal_missing_subscription'] ?? '') !== '', function (Builder $builder) { + // 只看“续费但未绑定订阅”的脏数据(可治理) + $builder->where('order_type', 'renewal') + ->whereNull('site_subscription_id'); + }) ->when(($filters['batch_synced_24h'] ?? '') !== '', function (Builder $builder) { // 只看最近 24 小时批量同步过的订单(基于 meta.batch_activation.at) $since = now()->subHours(24)->format('Y-m-d H:i:s'); diff --git a/resources/views/admin/platform_orders/index.blade.php b/resources/views/admin/platform_orders/index.blade.php index bc3cf35..90a03fd 100644 --- a/resources/views/admin/platform_orders/index.blade.php +++ b/resources/views/admin/platform_orders/index.blade.php @@ -419,6 +419,14 @@