| @@ 140-150 (lines=11) @@ | ||
| 137 | ||
| 138 | // category |
|
| 139 | $categoryJoin = false; |
|
| 140 | if (!empty($searchData['category_id']) && $searchData['category_id']) { |
|
| 141 | $Categories = $searchData['category_id']->getSelfAndDescendants(); |
|
| 142 | if ($Categories) { |
|
| 143 | $qb |
|
| 144 | ->innerJoin('p.ProductCategories', 'pct') |
|
| 145 | ->innerJoin('pct.Category', 'c') |
|
| 146 | ->andWhere($qb->expr()->in('pct.Category', ':Categories')) |
|
| 147 | ->setParameter('Categories', $Categories); |
|
| 148 | $categoryJoin = true; |
|
| 149 | } |
|
| 150 | } |
|
| 151 | ||
| 152 | // name |
|
| 153 | if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) { |
|
| @@ 260-269 (lines=10) @@ | ||
| 257 | */ |
|
| 258 | ||
| 259 | // category |
|
| 260 | if (!empty($searchData['category_id']) && $searchData['category_id']) { |
|
| 261 | $Categories = $searchData['category_id']->getSelfAndDescendants(); |
|
| 262 | if ($Categories) { |
|
| 263 | $qb |
|
| 264 | ->innerJoin('p.ProductCategories', 'pct') |
|
| 265 | ->innerJoin('pct.Category', 'c') |
|
| 266 | ->andWhere($qb->expr()->in('pct.Category', ':Categories')) |
|
| 267 | ->setParameter('Categories', $Categories); |
|
| 268 | } |
|
| 269 | } |
|
| 270 | ||
| 271 | // status |
|
| 272 | if (!empty($searchData['status']) && $searchData['status']) { |
|