refactor: swap sorting in laravel to ordering in the database

This commit is contained in:
Roardom
2023-06-19 08:13:39 +00:00
parent 80428fdc88
commit 1fa4a3e506
22 changed files with 63 additions and 62 deletions
+1 -1
View File
@@ -85,7 +85,7 @@ class StatsController extends Controller
$numTorrent = cache()->remember('num_torrent', $this->carbon, fn () => Torrent::count());
// Total Categories With Torrent Count
$categories = Category::withCount('torrents')->get()->sortBy('position');
$categories = Category::withCount('torrents')->orderBy('position')->get();
// Total HD Count
$numHd = cache()->remember('num_hd', $this->carbon, fn () => Torrent::where('sd', '=', 0)->count());