From fec96337c0a2e6e704b31207d2b13fac706bdaae Mon Sep 17 00:00:00 2001 From: rahul shukla Date: Tue, 29 Dec 2020 20:35:37 +0530 Subject: [PATCH 1/2] added removed condtion for multiselect serach --- packages/Webkul/Product/src/Repositories/ProductRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/Webkul/Product/src/Repositories/ProductRepository.php b/packages/Webkul/Product/src/Repositories/ProductRepository.php index 7a7f09921..75f250f99 100755 --- a/packages/Webkul/Product/src/Repositories/ProductRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductRepository.php @@ -242,7 +242,7 @@ class ProductRepository extends Repository // $attributeValueQuery->orWhereRaw("find_in_set(?, {$column})", [$filterValue]); // } - $attributeValueQuery->whereIn($column, $filterInputValues); + $attributeValueQuery->orWhereRaw("find_in_set(?, {$column})", [$filterInputValues]); }); } else { From 53ea1f2abf6a56bf41420afe02dbcdd3f5a7a581 Mon Sep 17 00:00:00 2001 From: rahul shukla Date: Tue, 29 Dec 2020 20:39:17 +0530 Subject: [PATCH 2/2] added removed condtion for multiselect serach --- .../Product/src/Repositories/ProductRepository.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/Webkul/Product/src/Repositories/ProductRepository.php b/packages/Webkul/Product/src/Repositories/ProductRepository.php index 75f250f99..e6776d091 100755 --- a/packages/Webkul/Product/src/Repositories/ProductRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductRepository.php @@ -235,14 +235,12 @@ class ProductRepository extends Repository if ($attribute->type != 'price') { $attributeQuery->where(function ($attributeValueQuery) use ($column, $filterInputValues) { - // foreach ($filterInputValues as $filterValue) { - // if (! is_numeric($filterValue)) { - // continue; - // } - // $attributeValueQuery->orWhereRaw("find_in_set(?, {$column})", [$filterValue]); - // } - - $attributeValueQuery->orWhereRaw("find_in_set(?, {$column})", [$filterInputValues]); + foreach ($filterInputValues as $filterValue) { + if (! is_numeric($filterValue)) { + continue; + } + $attributeValueQuery->orWhereRaw("find_in_set(?, {$column})", [$filterValue]); + } }); } else {