提交 1f96427c 编写于 作者: D devil_gong

分类优化

上级 a699316a
...@@ -186,6 +186,7 @@ class GoodsService ...@@ -186,6 +186,7 @@ class GoodsService
foreach($goods_category as &$v) foreach($goods_category as &$v)
{ {
$category_ids = self::GoodsCategoryItemsIds([$v['id']], 1); $category_ids = self::GoodsCategoryItemsIds([$v['id']], 1);
print_r($category_ids);
$goods = self::CategoryGoodsList(['where'=>['gci.category_id'=>$category_ids, 'g.is_home_recommended'=>1, 'g.is_shelves'=>1], 'm'=>0, 'n'=>8, 'field'=>'g.*']); $goods = self::CategoryGoodsList(['where'=>['gci.category_id'=>$category_ids, 'g.is_home_recommended'=>1, 'g.is_shelves'=>1], 'm'=>0, 'n'=>8, 'field'=>'g.*']);
$v['goods'] = $goods['data']; $v['goods'] = $goods['data'];
} }
...@@ -216,9 +217,10 @@ class GoodsService ...@@ -216,9 +217,10 @@ class GoodsService
$temp = self::GoodsCategoryItemsIds($data, $is_enable); $temp = self::GoodsCategoryItemsIds($data, $is_enable);
if(!empty($temp)) if(!empty($temp))
{ {
$data = array_merge($ids, $data, $temp); $data = array_merge($data, $temp);
} }
} }
$data = empty($data) ? $ids : array_merge($ids, $data);
return $data; return $data;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册