From 6bb11edffaa0850f741022b608a4c032986b45c4 Mon Sep 17 00:00:00 2001 From: horus Date: Sat, 11 Apr 2020 19:43:35 +0200 Subject: Changes order in search. --- app/Http/Controllers/IndexController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/Http/Controllers/IndexController.php b/app/Http/Controllers/IndexController.php index 955a8d8..cb401b5 100644 --- a/app/Http/Controllers/IndexController.php +++ b/app/Http/Controllers/IndexController.php @@ -53,7 +53,7 @@ class IndexController extends Controller $articles = new Article; if ( "on" == $request->input("onlypopular") ) { - $articles = $articles->setTable('view_popular'); + $articles = $articles->setTable('view_popular'); } foreach($search_unsafe as $q) { @@ -70,7 +70,9 @@ class IndexController extends Controller } $count = $articles->count(); - $articles = $articles->orderBy('impact', 'desc'); + if ( "on" == $request->input("onlypopular") ) { + $articles = $articles->orderBy('impact', 'desc'); + } $articles = $articles->orderBy('created_at', 'desc'); $articles = $articles->simplePaginate(10); -- cgit v1.2.3