作者 lyh

gx

@@ -115,9 +115,7 @@ class ProductController extends BaseController @@ -115,9 +115,7 @@ class ProductController extends BaseController
115 $str[] = $this->map['category_id']; 115 $str[] = $this->map['category_id'];
116 $this->getAllSub($this->map['category_id'],$str); 116 $this->getAllSub($this->map['category_id'],$str);
117 $query->where(function ($subQuery) use ($str) { 117 $query->where(function ($subQuery) use ($str) {
118 - foreach ($str as $v) {  
119 - $subQuery->orWhereRaw("FIND_IN_SET(?, category_id) > 0", [$v]);  
120 - } 118 + $subQuery->orWhereRaw("FIND_IN_SET(?, category_id) > 0", $str);
121 }); 119 });
122 } 120 }
123 if(isset($this->map['title']) && !empty($this->map['title'])){ 121 if(isset($this->map['title']) && !empty($this->map['title'])){