diff options
| author | horus | 2020-04-11 19:43:35 +0200 |
|---|---|---|
| committer | horus | 2020-04-11 19:43:35 +0200 |
| commit | 6bb11edffaa0850f741022b608a4c032986b45c4 (patch) | |
| tree | 9af0dbf72a547c3fe3ab2cbdb536771efc2dc689 /app | |
| parent | 5125d811a9e8effd7e098906775e17b724e11fd7 (diff) | |
| download | curious-6bb11edffaa0850f741022b608a4c032986b45c4.tar.gz | |
Changes order in search.
Diffstat (limited to 'app')
| -rw-r--r-- | app/Http/Controllers/IndexController.php | 6 |
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); |
