| @@ 102-112 (lines=11) @@ | ||
| 99 | ||
| 100 | // category |
|
| 101 | $categoryJoin = false; |
|
| 102 | if (!empty($searchData['category_id']) && $searchData['category_id']) { |
|
| 103 | $Categories = $searchData['category_id']->getSelfAndDescendants(); |
|
| 104 | if ($Categories) { |
|
| 105 | $qb |
|
| 106 | ->innerJoin('p.ProductCategories', 'pct') |
|
| 107 | ->innerJoin('pct.Category', 'c') |
|
| 108 | ->andWhere($qb->expr()->in('pct.Category', ':Categories')) |
|
| 109 | ->setParameter('Categories', $Categories); |
|
| 110 | $categoryJoin = true; |
|
| 111 | } |
|
| 112 | } |
|
| 113 | ||
| 114 | // name |
|
| 115 | if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) { |
|
| @@ 217-226 (lines=10) @@ | ||
| 214 | */ |
|
| 215 | ||
| 216 | // category |
|
| 217 | if (!empty($searchData['category_id']) && $searchData['category_id']) { |
|
| 218 | $Categories = $searchData['category_id']->getSelfAndDescendants(); |
|
| 219 | if ($Categories) { |
|
| 220 | $qb |
|
| 221 | ->innerJoin('p.ProductCategories', 'pct') |
|
| 222 | ->innerJoin('pct.Category', 'c') |
|
| 223 | ->andWhere($qb->expr()->in('pct.Category', ':Categories')) |
|
| 224 | ->setParameter('Categories', $Categories); |
|
| 225 | } |
|
| 226 | } |
|
| 227 | ||
| 228 | // status |
|
| 229 | if (!empty($searchData['status']) && $searchData['status']) { |
|