get_category_recommend_goods的正确使用

get_category_recommend_goods($type = '', $cats = '', $brand = 0, $min =0,  $max = 0, $ext='')

位于lib_goods.php

/**
* 获得指定分类下的推荐商品
*
* @access public
* @param string $type 推荐类型,可以是 best, new, hot, promote
* @param string $cats 分类的ID
* @param integer $brand 品牌的ID
* @param integer $min 商品价格下限
* @param integer $max 商品价格上限
* @param string $ext 商品扩展查询
* @return array
*/

$cats不是传递具体的产品分类id,而是传递类似于:g.cat_id  IN ('3','5')

需要配合函数:get_children($cat_id)

使用方法:

get_category_recommend_goods('best',get_children($cat_id))

 

posted on 2017-01-18 14:23  飞哥100  阅读(817)  评论(0)    收藏  举报

导航