feat(plans): 列表显示关联订阅/订单数量并提供跳转
This commit is contained in:
@@ -89,7 +89,7 @@ class PlanController extends Controller
|
||||
'published' => trim((string) $request->query('published', '')),
|
||||
];
|
||||
|
||||
$plansQuery = $this->applyFilters(Plan::query(), $filters);
|
||||
$plansQuery = $this->applyFilters(Plan::query()->withCount(['subscriptions', 'platformOrders']), $filters);
|
||||
|
||||
$plans = (clone $plansQuery)
|
||||
->orderBy('sort')
|
||||
@@ -111,6 +111,9 @@ class PlanController extends Controller
|
||||
'yearly_plans' => (clone $plansQuery)->where('billing_cycle', 'yearly')->count(),
|
||||
'published_plans' => (clone $plansQuery)->whereNotNull('published_at')->count(),
|
||||
'unpublished_plans' => (clone $plansQuery)->whereNull('published_at')->count(),
|
||||
// 治理联动:当前筛选范围内关联订阅/订单总量
|
||||
'subscriptions_count' => (clone $plansQuery)->sum('subscriptions_count'),
|
||||
'platform_orders_count' => (clone $plansQuery)->sum('platform_orders_count'),
|
||||
],
|
||||
'statusLabels' => $this->statusLabels(),
|
||||
'billingCycleLabels' => $this->billingCycleLabels(),
|
||||
|
||||
Reference in New Issue
Block a user