From af8c296abf84ef9cf74686fce05401ad866501ba Mon Sep 17 00:00:00 2001 From: Hannes Matuschek Date: Sun, 30 Aug 2020 00:44:55 +0200 Subject: [PATCH] Fixed 'Number of parts with price information' statistic. --- src/Repository/PartRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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');