作者 lyh

gx

@@ -114,9 +114,6 @@ class ProductController extends BaseController @@ -114,9 +114,6 @@ class ProductController extends BaseController
114 $str[] = $this->map['category_id']; 114 $str[] = $this->map['category_id'];
115 $str = $this->getAllSub($this->map['category_id'],$str); 115 $str = $this->getAllSub($this->map['category_id'],$str);
116 $productArr = CategoryRelated::whereIn('cate_id',$str)->pluck('product_id')->toArray(); 116 $productArr = CategoryRelated::whereIn('cate_id',$str)->pluck('product_id')->toArray();
117 - if($this->user['project_id'] == '475'){  
118 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($str, true) . PHP_EOL, FILE_APPEND);  
119 - }  
120 $query->whereIn('id',$productArr); 117 $query->whereIn('id',$productArr);
121 } 118 }
122 if(isset($this->map['title']) && !empty($this->map['title'])){ 119 if(isset($this->map['title']) && !empty($this->map['title'])){
@@ -67,11 +67,9 @@ class Category extends Base @@ -67,11 +67,9 @@ class Category extends Base
67 * @date 2023/4/28 67 * @date 2023/4/28
68 */ 68 */
69 public function getProductNum($cate_id){ 69 public function getProductNum($cate_id){
70 - $str[] = $cate_id; 70 + $str = [];
71 $cate_ids = $this->getAllSub($cate_id,$str); 71 $cate_ids = $this->getAllSub($cate_id,$str);
72 $count = CategoryRelated::whereIn('cate_id',$cate_ids)->count(); 72 $count = CategoryRelated::whereIn('cate_id',$cate_ids)->count();
73 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($cate_ids, true) . PHP_EOL, FILE_APPEND);  
74 -// $str = 0;  
75 return $count; 73 return $count;
76 } 74 }
77 } 75 }