From e5cfb4b5a91e4c9ef7fcf3ed1064f0c13d933912 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 21 Oct 2015 15:54:06 +0200 Subject: [PATCH] Bugfix Order --- .idea/workspace.xml | 17 ++++++++++++----- app/routes.php | 4 ++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 31c7574..1142609 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,6 +2,7 @@ + @@ -100,8 +101,8 @@ - - + + @@ -475,7 +476,13 @@ @@ -937,8 +944,8 @@ - - + + diff --git a/app/routes.php b/app/routes.php index 8e2ce42..1d4b16a 100644 --- a/app/routes.php +++ b/app/routes.php @@ -501,7 +501,7 @@ Route::get('stats', function() { 'name' => 'Bewertet am besten', 'entr' => array('', ''), 'vals' => Comment::addselect(DB::raw('film_comments.*, ROUND(AVG(`bewertung`),1) as count')) - ->where('bewertung', '!=', 0)->groupBy('user')->orderBy('count', 'DESC')->take(3)->get(), + ->where('bewertung', '!=', 0)->groupBy('user')->orderBy('count', 'DESC')->raw('ORDER BY COUNT(*) DESC')->take(3)->get(), 'prop' => 'autor', 'type' => 'User' ), @@ -509,7 +509,7 @@ Route::get('stats', function() { 'name' => 'Bewertet am schlechtesten', 'entr' => array('', ''), 'vals' => Comment::addselect(DB::raw('film_comments.*, ROUND(AVG(`bewertung`),1) as count')) - ->where('bewertung', '!=', 0)->groupBy('user')->orderBy('count', 'ASC')->take(3)->get(), + ->where('bewertung', '!=', 0)->groupBy('user')->orderBy('count', 'ASC')->raw('ORDER BY COUNT(*) ASC')->take(3)->get(), 'prop' => 'autor', 'type' => 'User' ),