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