|
...
|
...
|
@@ -52,11 +52,8 @@ class Category extends Base |
|
|
|
*/
|
|
|
|
public static function getProductNum($cate_id){
|
|
|
|
$cate_ids = self::getChildIdsArr($cate_id);
|
|
|
|
$str = 0;
|
|
|
|
foreach ($cate_ids as $v){
|
|
|
|
$count = Product::where('category_id','like','%,'.$v.',%')->count();
|
|
|
|
$str = $str+$count;
|
|
|
|
}
|
|
|
|
$count = CategoryRelated::whereIn('category_id',$cate_ids)->count();
|
|
|
|
$str = $count;
|
|
|
|
return $str;
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|