|
...
|
...
|
@@ -154,11 +154,9 @@ class ProductController extends BaseController |
|
|
|
if (isset($this->map['category_id']) && !empty($this->map['category_id'])) {
|
|
|
|
$str[] = $this->map['category_id'];
|
|
|
|
$this->getAllSub($this->map['category_id'],$str);
|
|
|
|
$query->where(function ($subQuery) use ($str) {
|
|
|
|
foreach ($str as $v) {
|
|
|
|
$subQuery->orWhereRaw("FIND_IN_SET(?, category_id) > 0", [$v]);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
$categoryRelatedModel = new CategoryRelated();
|
|
|
|
$product_id_arr = $categoryRelatedModel->whereIn('cate_id',$str)->pluck('product_id')->toArray();
|
|
|
|
$query = $query->whereIn('id',$product_id_arr);
|
|
|
|
}
|
|
|
|
if(isset($this->map['title']) && !empty($this->map['title'])){
|
|
|
|
$query = $query->where('title','like','%'.$this->map['title'].'%');
|
...
|
...
|
|