Blog items sorted by updated

This commit is contained in:
2020-03-24 19:58:40 +01:00
parent 507ad08488
commit 0507d363f0

View File

@@ -190,7 +190,7 @@ QUERY;
$startIndex = ($page - 1) * $count;
$blogItems = app('db')->select($sql = self::$BASE_SQL
. ' AND `news`.`startdt` >= :start AND `news`.`startdt` <= :end'
. ' ORDER BY `news`.`startdt` DESC'
. ' ORDER BY COALESCE(`news`.`pubupdatedt`, `news`.`creationdt`) DESC'
. ' LIMIT ' . (int)$startIndex . ', ' . (int)$count,
['category' => $blog->news_category, 'secondarycategory' => 0, 'start' => $blog->start_date, 'end' => $blog->end_date]);