请教ecshop首页商品相册问题
1个回答
展开全部
1.后台根据商品图顺序上传,结果后台商品相册内显示的商品图顺序并不是根据上传顺序显示。
2.显示顺序是混乱的.
可以修改"includes\lib_goods.php"function get_goods_gallery 这个函数
$sql = 'SELECT img_id, img_url, thumb_url, img_desc' .
' FROM ' . $GLOBALS['ecs']->table('goods_gallery') .
" WHERE goods_id = '$goods_id' LIMIT " . $GLOBALS['_CFG']['goods_gallery_number']." ORDER BY img_id DESC ;
order by img_id DESC 是安降序排列,但它不能放在limit的后面.所以会报错,应该改成:
$sql = 'SELECT img_id, img_url, thumb_url, img_desc' .
' FROM ' . $GLOBALS['ecs']->table('goods_gallery') .
" WHERE goods_id = '$goods_id' ORDER BY img_id DESC LIMIT " . $GLOBALS['_CFG']['goods_gallery_number'];
(includes\lib_goods.php function get_goods_gallery函数)
这样就不会报错了.如果不想安降序排列把DESC去掉就行了.
2.显示顺序是混乱的.
可以修改"includes\lib_goods.php"function get_goods_gallery 这个函数
$sql = 'SELECT img_id, img_url, thumb_url, img_desc' .
' FROM ' . $GLOBALS['ecs']->table('goods_gallery') .
" WHERE goods_id = '$goods_id' LIMIT " . $GLOBALS['_CFG']['goods_gallery_number']." ORDER BY img_id DESC ;
order by img_id DESC 是安降序排列,但它不能放在limit的后面.所以会报错,应该改成:
$sql = 'SELECT img_id, img_url, thumb_url, img_desc' .
' FROM ' . $GLOBALS['ecs']->table('goods_gallery') .
" WHERE goods_id = '$goods_id' ORDER BY img_id DESC LIMIT " . $GLOBALS['_CFG']['goods_gallery_number'];
(includes\lib_goods.php function get_goods_gallery函数)
这样就不会报错了.如果不想安降序排列把DESC去掉就行了.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询