| @@ 76-86 (lines=11) @@ | ||
| 73 | ||
| 74 | // category |
|
| 75 | $categoryJoin = false; |
|
| 76 | if (!empty($searchData['category_id']) && $searchData['category_id']) { |
|
| 77 | $Categories = $searchData['category_id']->getSelfAndDescendants(); |
|
| 78 | if ($Categories) { |
|
| 79 | $qb |
|
| 80 | ->innerJoin('p.ProductCategories', 'pct') |
|
| 81 | ->innerJoin('pct.Category', 'c') |
|
| 82 | ->andWhere($qb->expr()->in('pct.Category', ':Categories')) |
|
| 83 | ->setParameter('Categories', $Categories); |
|
| 84 | $categoryJoin = true; |
|
| 85 | } |
|
| 86 | } |
|
| 87 | ||
| 88 | // name |
|
| 89 | if (isset($searchData['name']) && Str::isNotBlank($searchData['name'])) { |
|
| @@ 183-192 (lines=10) @@ | ||
| 180 | */ |
|
| 181 | ||
| 182 | // category |
|
| 183 | if (!empty($searchData['category_id']) && $searchData['category_id']) { |
|
| 184 | $Categories = $searchData['category_id']->getSelfAndDescendants(); |
|
| 185 | if ($Categories) { |
|
| 186 | $qb |
|
| 187 | ->innerJoin('p.ProductCategories', 'pct') |
|
| 188 | ->innerJoin('pct.Category', 'c') |
|
| 189 | ->andWhere($qb->expr()->in('pct.Category', ':Categories')) |
|
| 190 | ->setParameter('Categories', $Categories); |
|
| 191 | } |
|
| 192 | } |
|
| 193 | ||
| 194 | // status |
|
| 195 | if (!empty($searchData['status']) && $searchData['status']) { |
|