ecshop左侧浏览历史按照浏览先后进行排序方法

2016-09-02 16:28 来源:www.chinab4c.com 作者:ecshop专家

打开 includes/lib_insert.php,找到如下代码: $sql = \'SELECT goods_id, goods_name, goods_thumb, shop_price FROM \' . $GLOBALS[\'ecs\']->table(\'goods\') . \" WHERE $where AND is_on_sale = 1 AND is_alone_sale = 1 AND is_delete = 0\"; $query = $GLOBALS[\'db\']->query($sql); 将代码改为如下 $sql = \'SELECT goods_id, goods_name, goods_thumb, shop_price FROM \' . $GLOBALS[\'ecs\']->table(\'goods\') . \" WHERE $where AND is_on_sale = 1 AND is_alone_sale = 1 AND is_delete = 0 order by INSTR(\'\".$_COOKIE[\'ECS\'][\'history\'].\"\', goods_id)\"; $query = $GLOBALS[\'db\']->query($sql);