diff --git a/src/Repository/PartRepository.php b/src/Repository/PartRepository.php index b6aff3e4..1d5c1a7c 100644 --- a/src/Repository/PartRepository.php +++ b/src/Repository/PartRepository.php @@ -75,7 +75,7 @@ class PartRepository extends NamedDBElementRepository public function getPartsCountWithPrice(): int { $qb = $this->createQueryBuilder('part'); - $qb->select('COUNT(part)') + $qb->select('COUNT(DISTINCT part)') ->innerJoin('part.orderdetails', 'orderdetail') ->innerJoin('orderdetail.pricedetails', 'pricedetail') ->where('pricedetail.price > 0.0');