fix: only use active peers for stats and bon

This commit is contained in:
Roardom
2023-08-03 07:01:54 +00:00
parent 981f3e16d9
commit 1bc31fda9d
8 changed files with 16 additions and 6 deletions
+2
View File
@@ -165,6 +165,7 @@ class StatsController extends Controller
'seeders' => Peer::with('user')
->select(DB::raw('user_id, count(distinct torrent_id) as value'))
->where('seeder', '=', 1)
->where('active', '=', 1)
->groupBy('user_id')
->orderByDesc('value')
->take(100)
@@ -181,6 +182,7 @@ class StatsController extends Controller
'leechers' => Peer::with('user')
->select(DB::raw('user_id, count(*) as value'))
->where('seeder', '=', 0)
->where('active', '=', 1)
->groupBy('user_id')
->orderByDesc('value')
->take(100)