diff --git a/Changelog b/Changelog index d0359174b..e976814b0 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2019-03-20 DariusIII + * Fix: Fix site stats admin page * Chg: Update return type declarations on adult postprocessing classes * Chg: Update dariusiii/rarinfo (v2.7.4 => v2.7.4.1) * Chg: Update dariusiii/rarinfo (v2.7.3 => v2.7.4) diff --git a/app/Models/Category.php b/app/Models/Category.php index e6af7233d..667dc83eb 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -2,6 +2,7 @@ namespace App\Models; +use Illuminate\Support\Facades\DB; use Watson\Rememberable\Rememberable; use Illuminate\Database\Eloquent\Model; @@ -276,8 +277,7 @@ class Category extends Model ->with('parent') ->remember(config('nntmux.cache_expiry_long')) ->where('r.adddate', '>', now()->subWeek()) - ->selectRaw('CONCAT(cp.title, " > ", categories.title) as title') - ->selectRaw('COUNT(r.id) as count') + ->select(['root_categories_id', DB::raw('COUNT(r.id) as count'), 'title']) ->join('releases as r', 'r.categories_id', '=', 'categories.id') ->groupBy('title') ->orderBy('count', 'desc') diff --git a/resources/views/themes/admin/site-stats.tpl b/resources/views/themes/admin/site-stats.tpl index acf414781..02b3e5908 100644 --- a/resources/views/themes/admin/site-stats.tpl +++ b/resources/views/themes/admin/site-stats.tpl @@ -106,7 +106,7 @@ {foreach from=$recent item=result}