feat(admin): 仪表盘补齐订阅到期治理入口(7天内到期/已过期)

This commit is contained in:
萝卜
2026-03-15 19:34:32 +08:00
parent b7471026ef
commit dc7b7b395c
3 changed files with 53 additions and 2 deletions

View File

@@ -38,6 +38,15 @@ class DashboardController extends Controller
// 收费中心(平台侧)
'plans' => Plan::count(),
'site_subscriptions' => SiteSubscription::count(),
'site_subscriptions_expired' => SiteSubscription::query()
->whereNotNull('ends_at')
->where('ends_at', '<', now())
->count(),
'site_subscriptions_expiring_7d' => SiteSubscription::query()
->whereNotNull('ends_at')
->where('ends_at', '>=', now())
->where('ends_at', '<', now()->addDays(7))
->count(),
'platform_orders' => PlatformOrder::count(),
'platform_orders_unpaid_pending' => PlatformOrder::query()
->where('payment_status', 'unpaid')