summaryrefslogtreecommitdiff
path: root/app/Http/Controllers/IndexController.php
diff options
context:
space:
mode:
authorhorus2020-04-11 19:43:35 +0200
committerhorus2020-04-11 19:43:35 +0200
commit6bb11edffaa0850f741022b608a4c032986b45c4 (patch)
tree9af0dbf72a547c3fe3ab2cbdb536771efc2dc689 /app/Http/Controllers/IndexController.php
parent5125d811a9e8effd7e098906775e17b724e11fd7 (diff)
downloadcurious-6bb11edffaa0850f741022b608a4c032986b45c4.tar.gz
Changes order in search.
Diffstat (limited to 'app/Http/Controllers/IndexController.php')
-rw-r--r--app/Http/Controllers/IndexController.php6
1 files changed, 4 insertions, 2 deletions
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);