Browse Source

Processus de commande

feature/export_comptable
Fab 4 years ago
parent
commit
7b83af65d3
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      ShopBundle/Repository/OrderShopRepository.php

+ 6
- 3
ShopBundle/Repository/OrderShopRepository.php View File

public function countValidOrderWithReductionCredit($reductionCredit, $user){ public function countValidOrderWithReductionCredit($reductionCredit, $user){
$query = $this->findByMerchantQuery(); $query = $this->findByMerchantQuery();
$query = $this->filterOrderValid($query); $query = $this->filterOrderValid($query);
$query->select('count(e.id)');
$query->andWhere('e.user = :user'); $query->andWhere('e.user = :user');
$query->leftJoin('e.orderReductionCredits', 'orc'); $query->leftJoin('e.orderReductionCredits', 'orc');
$query->andWhere('orc.reductionCredit = :reductionCredit'); $query->andWhere('orc.reductionCredit = :reductionCredit');
$query->setParameter('reductionCredit', $reductionCredit); $query->setParameter('reductionCredit', $reductionCredit);
$query->setParameter('user', $user); $query->setParameter('user', $user);
return $query->getQuery()->getScalarResult();
return $query->getQuery()->getSingleScalarResult();
} }




public function countValidOrderWithReductionCart($reductionCart){ public function countValidOrderWithReductionCart($reductionCart){
$query = $this->findByMerchantQuery(); $query = $this->findByMerchantQuery();
$query = $this->filterOrderValid($query); $query = $this->filterOrderValid($query);
$query->select('count(e.id)');
$query->leftJoin('e.orderReductionCart', 'orc'); $query->leftJoin('e.orderReductionCart', 'orc');
$query->andWhere('orc.reductionCart = :reductionCart'); $query->andWhere('orc.reductionCart = :reductionCart');
$query->setParameter('reductionCart', $reductionCart); $query->setParameter('reductionCart', $reductionCart);
return $query->getQuery()->getScalarResult();
return $query->getQuery()->getSingleScalarResult();
} }




public function countValidOrderWithReductionCartPerUser($reductionCart, $user){ public function countValidOrderWithReductionCartPerUser($reductionCart, $user){
$query = $this->findByMerchantQuery(); $query = $this->findByMerchantQuery();
$query = $this->filterOrderValid($query); $query = $this->filterOrderValid($query);
$query->select('count(e.id)');
$query->andWhere('e.user = :user'); $query->andWhere('e.user = :user');
$query->leftJoin('e.orderReductionCart', 'orc'); $query->leftJoin('e.orderReductionCart', 'orc');
$query->andWhere('orc.reductionCart = :reductionCart'); $query->andWhere('orc.reductionCart = :reductionCart');
$query->setParameter('reductionCart', $reductionCart); $query->setParameter('reductionCart', $reductionCart);
$query->setParameter('user', $user); $query->setParameter('user', $user);
return $query->getQuery()->getScalarResult();
return $query->getQuery()->getSingleScalarResult();
} }





Loading…
Cancel
Save