mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-29 07:27:26 +08:00
feat: enhance plan user statistics with active user count display
This commit is contained in:
@@ -18,7 +18,15 @@ class PlanController extends Controller
|
|||||||
->with([
|
->with([
|
||||||
'group:id,name'
|
'group:id,name'
|
||||||
])
|
])
|
||||||
->withCount('users')
|
->withCount([
|
||||||
|
'users',
|
||||||
|
'users as active_users_count' => function ($query) {
|
||||||
|
$query->where(function ($q) {
|
||||||
|
$q->where('expired_at', '>', time())
|
||||||
|
->orWhereNull('expired_at');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
])
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
return $this->success($plans);
|
return $this->success($plans);
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+7
-7
File diff suppressed because one or more lines are too long
Vendored
+65
-60
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user