@@ 96-106 (lines=11) @@ | ||
93 | ||
94 | // category |
|
95 | $categoryJoin = false; |
|
96 | if (!empty($searchData['category_id']) && $searchData['category_id']) { |
|
97 | $Categories = $searchData['category_id']->getSelfAndDescendants(); |
|
98 | if ($Categories) { |
|
99 | $qb |
|
100 | ->innerJoin('p.ProductCategories', 'pct') |
|
101 | ->innerJoin('pct.Category', 'c') |
|
102 | ->andWhere($qb->expr()->in('pct.Category', ':Categories')) |
|
103 | ->setParameter('Categories', $Categories); |
|
104 | $categoryJoin = true; |
|
105 | } |
|
106 | } |
|
107 | ||
108 | // name |
|
109 | if (isset($searchData['name']) && Str::isNotBlank($searchData['name'])) { |
|
@@ 203-212 (lines=10) @@ | ||
200 | */ |
|
201 | ||
202 | // category |
|
203 | if (!empty($searchData['category_id']) && $searchData['category_id']) { |
|
204 | $Categories = $searchData['category_id']->getSelfAndDescendants(); |
|
205 | if ($Categories) { |
|
206 | $qb |
|
207 | ->innerJoin('p.ProductCategories', 'pct') |
|
208 | ->innerJoin('pct.Category', 'c') |
|
209 | ->andWhere($qb->expr()->in('pct.Category', ':Categories')) |
|
210 | ->setParameter('Categories', $Categories); |
|
211 | } |
|
212 | } |
|
213 | ||
214 | // status |
|
215 | if (!empty($searchData['status']) && $searchData['status']->toArray()) { |