| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function countSalesByAffiliate(AffiliateInterface $affiliate): int |
||
| 15 | { |
||
| 16 | return (int) $this->createQueryBuilder('o') |
||
| 17 | ->select('COUNT(o.id)') |
||
| 18 | ->innerJoin('o.affiliateReferral', 'ar') |
||
| 19 | ->andWhere('ar.affiliate = :affiliate') |
||
| 20 | ->andWhere('o.paymentState = :paymentState') |
||
| 21 | ->setParameter('affiliate', $affiliate) |
||
| 22 | ->setParameter('paymentState', OrderPaymentStates::STATE_PAID) |
||
| 23 | ->getQuery() |
||
| 24 | ->getSingleScalarResult() |
||
| 25 | ; |
||
| 28 |