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

2016-09-11 20:38 来源:www.chinab4c.com 作者:ecshop专家

Ecshop添加新的文章不知道依照什么规则排序


主要修改 \\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)


即可