From fc947b05ff9548958d1f5712f6c6b26fc5a5a55b Mon Sep 17 00:00:00 2001 From: Mischa Spelt Date: Wed, 24 Jan 2018 18:03:06 +0100 Subject: [PATCH] Nieuws sorteren op publieke Laatst Bijgewerkt-datum, indien beschikbaar --- api/app/Http/Controllers/NewsController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/app/Http/Controllers/NewsController.php b/api/app/Http/Controllers/NewsController.php index ac564b5..9b17934 100644 --- a/api/app/Http/Controllers/NewsController.php +++ b/api/app/Http/Controllers/NewsController.php @@ -59,7 +59,7 @@ QUERY; $start = ($page - 1) * $count; $newsItems = app('db')->select(self::$BASE_SQL . $filterSql - . ' ORDER BY `published` DESC' + . ' ORDER BY COALESCE(`news`.`pubupdatedt`, `news`.`creationdt`) DESC' . ' LIMIT ' . (int)$start . ', ' . (int)$count, $params); $result = array(); @@ -95,7 +95,7 @@ QUERY; $newsItems = app('db')->select(self::$BASE_SQL . ' AND `news`.`creationdt` >= :startRange AND `news`.`creationdt` <= :endRange' . ' AND MATCH(`content`.`title`, `content`.`content`) AGAINST(:query IN BOOLEAN MODE)' - . ' ORDER BY `published` DESC' + . ' ORDER BY COALESCE(`news`.`pubupdatedt`, `news`.`creationdt`) DESC' . ' LIMIT 0, 20', [ 'category' => self::$NEWS_CATEGORY, 'startRange' => $searchRange[0]->format('Y-m-d'),