fix(admin-dashboard): scope plan share to last 7 days

This commit is contained in:
萝卜
2026-03-16 10:58:54 +08:00
parent f7f7f6d4f1
commit 94e55d9ac2

View File

@@ -196,9 +196,10 @@ class DashboardController extends Controller
->limit(5) ->limit(5)
->get(); ->get();
// 占比卡(最小可用):按套餐统计平台订单数量 TopN // 占比卡(最小可用):近 7 天按套餐统计平台订单数量 TopN
$planOrderShare = PlatformOrder::query() $planOrderShare = PlatformOrder::query()
->selectRaw('plan_id, COUNT(*) as cnt') ->selectRaw('plan_id, COUNT(*) as cnt')
->whereBetween('created_at', [$trendStart, $trendEnd])
->whereNotNull('plan_id') ->whereNotNull('plan_id')
->groupBy('plan_id') ->groupBy('plan_id')
->orderByDesc('cnt') ->orderByDesc('cnt')