ecshop如何限制促销栏目某分类下的促销商品不要显示?

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

本篇文章主要介绍了“ecshop如何限制某分类下的促销商品不要显示”,主要涉及到方面的内容,对于web前端感兴趣的同学可以参考一下: 首页打开includes文件夹里的lib_goods.php文件,搜索如下代码: function get_promote_goods($cats = \'\') { $time = gmtime(); $order_type = $GLOBALS[\'_CFG\'][\'recommend_order\']; /* 取得促销lbi的数量限制 */ $num = get_library_number(\"recommend_promotion\"); $sql = \'SELECT g.goods_id, g.goods_name, g.goods_name_style, g.market_price, g.shop_price AS org_price, g.promote_price, \' . \"INULLmp.user_price, g.shop_price * \'$_SESSION[discount]\') AS shop_price, \". \"promote_start_date, promote_end_date, g.goods_brief, g.goods_thumb, goods_img, b.brand_name, \" . \"g.is_best, g.is_new, g.is_hot, g.is_promote, RAND() AS rnd \" . \'FROM \' . $GLOBALS[\'ecs\']->table(\'goods\') . \' AS g \' . \'LEFT JOIN \' . $GLOBALS[\'ecs\']->table(\'brand\') . \' AS b ON b.brand_id = g.brand_id \' . \"LEFT JOIN \" . $GLOBALS[\'ecs\']->table(\'member_price\') . \" AS mp \". \"ON mp.goods_id = g.goods_id AND mp.user_rank = \'$_SESSION[user_rank]\' \". \'WHERE g.is_on_sale = 1 AND g.is_alone_sale = 1 AND g.is_delete = 0 \' . \" AND g.is_promote = 1 AND promote_start_date <= \'$time\' AND promote_end_date >= \'$time\' \"; 将以上代码修过为如下,增加 AND g.cat_id <> 分类id 形如: function get_promote_goods($cats = \'\') { $time = gmtime(); $order_type = $GLOBALS[\'_CFG\'][\'recommend_order\']; /* 取得促销lbi的数量限制 */ $num = get_library_number(\"recommend_promotion\"); $sql = \'SELECT g.goods_id, g.goods_name, g.goods_name_style, g.market_price, g.shop_price AS org_price, g.promote_price, \' . \"IFNULL(mp.user_price, g.shop_price * \'$_SESSION[discount]\') AS shop_price, \". \"promote_start_date, promote_end_date, g.goods_brief, g.goods_thumb, goods_img, b.brand_name, \" . \"g.is_best, g.is_new, g.is_hot, g.is_promote, RAND() AS rnd \" . \'FROM \' . $GLOBALS[\'ecs\']->table(\'goods\') . \' AS g \' . \'LEFT JOIN \' . $GLOBALS[\'ecs\']->table(\'brand\') . \' AS b ON b.brand_id = g.brand_id \' . \"LEFT JOIN \" . $GLOBALS[\'ecs\']->table(\'member_price\') . \" AS mp \". \"ON mp.goods_id = g.goods_id AND mp.user_rank = \'$_SESSION[user_rank]\' \". \'WHERE g.is_on_sale = 1 AND g.is_alone_sale = 1 AND g.is_delete = 0 AND g.cat_id <> 3 \' . \" AND g.is_promote = 1 AND promote_start_date <= \'$time\' AND promote_end_date >= \'$time\' \";