正在显示
1 个修改的文件
包含
2 行增加
和
1 行删除
| @@ -69,7 +69,8 @@ class Category extends Base | @@ -69,7 +69,8 @@ class Category extends Base | ||
| 69 | public function getProductNum($cate_id){ | 69 | public function getProductNum($cate_id){ |
| 70 | $str[] = $cate_id; | 70 | $str[] = $cate_id; |
| 71 | $cate_ids = $this->getAllSub($cate_id,$str); | 71 | $cate_ids = $this->getAllSub($cate_id,$str); |
| 72 | - $productArr = CategoryRelated::whereIn('cate_id',$cate_ids)->pluck('product_id')->toArray(); | 72 | + $productArr = CategoryRelated::whereIn('cate_id',$cate_ids)->pluck('product_id')->unique()->toArray(); |
| 73 | + | ||
| 73 | $count = count($productArr); | 74 | $count = count($productArr); |
| 74 | return $count; | 75 | return $count; |
| 75 | } | 76 | } |
-
请 注册 或 登录 后发表评论