diff --git a/src/Helper/Jtl.php b/src/Helper/Jtl.php index 8aa0620..104a086 100644 --- a/src/Helper/Jtl.php +++ b/src/Helper/Jtl.php @@ -64,9 +64,7 @@ class Jtl $data = array(); $products = $this->productRepository->findById($prodIds); - foreach ($warehousesName as $wn) { - $warehouse = $this->warehouseRepository->findByWarehouseByName($wn); - } + $warehouse = $this->warehouseRepository->findByWarehouseByName($warehousesName); if ($warehouse) { foreach ($warehouse as $w) { diff --git a/src/Repository/WarehouseRepository.php b/src/Repository/WarehouseRepository.php index 99db806..3ed59db 100644 --- a/src/Repository/WarehouseRepository.php +++ b/src/Repository/WarehouseRepository.php @@ -49,9 +49,8 @@ class WarehouseRepository extends ServiceEntityRepository public function findByWarehouseByName($value): array { return $this->createQueryBuilder('w') - ->andWhere('w.name = :val') + ->andWhere('w.name in (:val)') ->setParameter('val', $value) - ->orderBy('w.id', 'ASC') ->getQuery() ->getResult(); }