@@ 82-92 (lines=11) @@ | ||
79 | ||
80 | // category |
|
81 | $categoryJoin = false; |
|
82 | if (!empty($searchData['category_id']) && $searchData['category_id']) { |
|
83 | $Categories = $searchData['category_id']->getSelfAndDescendants(); |
|
84 | if ($Categories) { |
|
85 | $qb |
|
86 | ->innerJoin('p.ProductCategories', 'pct') |
|
87 | ->innerJoin('pct.Category', 'c') |
|
88 | ->andWhere($qb->expr()->in('pct.Category', ':Categories')) |
|
89 | ->setParameter('Categories', $Categories); |
|
90 | $categoryJoin = true; |
|
91 | } |
|
92 | } |
|
93 | ||
94 | // name |
|
95 | if (isset($searchData['name']) && Str::isNotBlank($searchData['name'])) { |
|
@@ 171-180 (lines=10) @@ | ||
168 | */ |
|
169 | ||
170 | // category |
|
171 | if (!empty($searchData['category_id']) && $searchData['category_id']) { |
|
172 | $Categories = $searchData['category_id']->getSelfAndDescendants(); |
|
173 | if ($Categories) { |
|
174 | $qb |
|
175 | ->innerJoin('p.ProductCategories', 'pct') |
|
176 | ->innerJoin('pct.Category', 'c') |
|
177 | ->andWhere($qb->expr()->in('pct.Category', ':Categories')) |
|
178 | ->setParameter('Categories', $Categories); |
|
179 | } |
|
180 | } |
|
181 | ||
182 | // status |
|
183 | if (!empty($searchData['status']) && $searchData['status']->toArray()) { |