作者 lyh

gx

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