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' ),