|
...
|
...
|
@@ -69,7 +69,8 @@ class Category extends Base |
|
|
|
public function getProductNum($cate_id){
|
|
|
|
$str[] = $cate_id;
|
|
|
|
$cate_ids = $this->getAllSub($cate_id,$str);
|
|
|
|
$productArr = CategoryRelated::whereIn('cate_id',$cate_ids)->pluck('product_id')->toArray();
|
|
|
|
$productArr = CategoryRelated::whereIn('cate_id',$cate_ids)->pluck('product_id')->unique()->toArray();
|
|
|
|
|
|
|
|
$count = count($productArr);
|
|
|
|
return $count;
|
|
|
|
}
|
...
|
...
|
|