正在显示
1 个修改的文件
包含
1 行增加
和
2 行删除
| @@ -111,9 +111,8 @@ class ProductController extends BaseController | @@ -111,9 +111,8 @@ class ProductController extends BaseController | ||
| 111 | public function searchParam(&$query){ | 111 | public function searchParam(&$query){ |
| 112 | $query = $query->where('project_id',$this->user['project_id']); | 112 | $query = $query->where('project_id',$this->user['project_id']); |
| 113 | if (isset($this->map['category_id']) && !empty($this->map['category_id'])) { | 113 | if (isset($this->map['category_id']) && !empty($this->map['category_id'])) { |
| 114 | - $str = []; | ||
| 115 | $str[] = $this->map['category_id']; | 114 | $str[] = $this->map['category_id']; |
| 116 | - $this->getAllSub($this->map['category_id'],$str); | 115 | + $str = $this->getAllSub($this->map['category_id'],$str); |
| 117 | $query->where(function ($subQuery) use ($str) { | 116 | $query->where(function ($subQuery) use ($str) { |
| 118 | foreach ($str as $v) { | 117 | foreach ($str as $v) { |
| 119 | $subQuery->orWhereRaw("FIND_IN_SET(?, category_id) > 0", [$v]); | 118 | $subQuery->orWhereRaw("FIND_IN_SET(?, category_id) > 0", [$v]); |
-
请 注册 或 登录 后发表评论