| @@ 81-91 (lines=11) @@ | ||
| 78 | ||
| 79 | // category |
|
| 80 | $categoryJoin = false; |
|
| 81 | if (!empty($searchData['category_id']) && $searchData['category_id']) { |
|
| 82 | $Categories = $searchData['category_id']->getSelfAndDescendants(); |
|
| 83 | if ($Categories) { |
|
| 84 | $qb |
|
| 85 | ->innerJoin('p.ProductCategories', 'pct') |
|
| 86 | ->innerJoin('pct.Category', 'c') |
|
| 87 | ->andWhere($qb->expr()->in('pct.Category', ':Categories')) |
|
| 88 | ->setParameter('Categories', $Categories); |
|
| 89 | $categoryJoin = true; |
|
| 90 | } |
|
| 91 | } |
|
| 92 | ||
| 93 | // name |
|
| 94 | if (isset($searchData['name']) && Str::isNotBlank($searchData['name'])) { |
|
| @@ 188-197 (lines=10) @@ | ||
| 185 | */ |
|
| 186 | ||
| 187 | // category |
|
| 188 | if (!empty($searchData['category_id']) && $searchData['category_id']) { |
|
| 189 | $Categories = $searchData['category_id']->getSelfAndDescendants(); |
|
| 190 | if ($Categories) { |
|
| 191 | $qb |
|
| 192 | ->innerJoin('p.ProductCategories', 'pct') |
|
| 193 | ->innerJoin('pct.Category', 'c') |
|
| 194 | ->andWhere($qb->expr()->in('pct.Category', ':Categories')) |
|
| 195 | ->setParameter('Categories', $Categories); |
|
| 196 | } |
|
| 197 | } |
|
| 198 | ||
| 199 | // status |
|
| 200 | if (!empty($searchData['status']) && $searchData['status']->toArray()) { |
|