diff options
Diffstat (limited to 'app/Http/Controllers/IndexController.php')
| -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); |
