ecshop如何让文章按照倒序排列

Ecshop添加新的文章不知道依照什么规则排序,现在ECHSOP开发中心()教程教大家按照发表时间排序

主要修改 \includes\lib_goods.php 文件

function index_get_class_articles($cat_aid, $cat_num){ $sql = "Select article_id, title,open_type,cat_id,file_url FROM " .$GLOBALS[‘ecs’]->table(‘article’). " Where cat_id = ".$cat_aid." and is_open = 1 LIMIT " . $cat_num; $res = $GLOBALS[‘db’]->getAll($sql); $arr = array(); foreach ($res AS $idx => $row)

修改为

function index_get_class_articles($cat_aid, $cat_num){ $sql = "Select article_id, title,open_type,cat_id,file_url FROM " .$GLOBALS[‘ecs’]->table(‘article’). " Where cat_id = ".$cat_aid." and is_open = 1 order by article_id desc LIMIT 0," . $cat_num; $res = $GLOBALS[‘db’]->getAll($sql); $arr = array(); foreach ($res AS $idx => $row)

即可

,后来逐渐有广州花城的,

ecshop如何让文章按照倒序排列

相关文章:

你感兴趣的文章:

标签云: