platform orders: syncable summary excludes renewal missing subscription

This commit is contained in:
萝卜
2026-03-15 05:52:21 +00:00
parent 4b1f661561
commit b940c0172d
2 changed files with 73 additions and 0 deletions

View File

@@ -414,6 +414,11 @@ class PlatformOrderController extends Controller
->where('payment_status', 'paid')
->where('status', 'activated')
->whereRaw("JSON_EXTRACT(meta, '$.subscription_activation.subscription_id') IS NULL")
// 口径一致:排除(续费但未绑定订阅)的脏数据
->where(function (\Illuminate\Database\Eloquent\Builder $q) {
$q->where('order_type', '!=', 'renewal')
->orWhereNotNull('site_subscription_id');
})
->count(),
'batch_synced_24h_orders' => (function () use ($baseQuery) {
$since = now()->subHours(24)->format('Y-m-d H:i:s');