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