|
|
|
|
|
|
|
|
protected $statusAliasAsCart = array('cart', 'waiting-payment-online', 'waiting-payment-credit', 'waiting-payment-on-delivery', 'error-payment-online'); |
|
|
protected $statusAliasAsCart = array('cart', 'waiting-payment-online', 'waiting-payment-credit', 'waiting-payment-on-delivery', 'error-payment-online'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function findValidOrderWithReductionCredit($reductionCredit, $user){ |
|
|
|
|
|
|
|
|
public function countValidOrderWithReductionCredit($reductionCredit, $user){ |
|
|
$query = $this->findByMerchantQuery(); |
|
|
$query = $this->findByMerchantQuery(); |
|
|
$query = $this->filterOrderValid($query); |
|
|
$query = $this->filterOrderValid($query); |
|
|
$query->andWhere('e.user = :user'); |
|
|
$query->andWhere('e.user = :user'); |
|
|
|
|
|
|
|
|
$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()->getResult(); |
|
|
|
|
|
|
|
|
return $query->getQuery()->getScalarResult(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function countValidOrderWithReductionCart($reductionCart){ |
|
|
|
|
|
$query = $this->findByMerchantQuery(); |
|
|
|
|
|
$query = $this->filterOrderValid($query); |
|
|
|
|
|
$query->leftJoin('e.orderReductionCart', 'orc'); |
|
|
|
|
|
$query->andWhere('orc.reductionCart = :reductionCart'); |
|
|
|
|
|
$query->setParameter('reductionCart', $reductionCart); |
|
|
|
|
|
return $query->getQuery()->getScalarResult(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function countValidOrderWithReductionCartPerUser($reductionCart, $user){ |
|
|
|
|
|
$query = $this->findByMerchantQuery(); |
|
|
|
|
|
$query = $this->filterOrderValid($query); |
|
|
|
|
|
$query->andWhere('e.user = :user'); |
|
|
|
|
|
$query->leftJoin('e.orderReductionCart', 'orc'); |
|
|
|
|
|
$query->andWhere('orc.reductionCart = :reductionCart'); |
|
|
|
|
|
$query->setParameter('reductionCart', $reductionCart); |
|
|
|
|
|
$query->setParameter('user', $user); |
|
|
|
|
|
return $query->getQuery()->getScalarResult(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
$query = $this->findByMerchantQuery() ; |
|
|
$query = $this->findByMerchantQuery() ; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(isset($params['user'])) { |
|
|
if(isset($params['user'])) { |
|
|
$query->andWhere('e.user = :user')->setParameter('user', $params['user']) ; |
|
|
$query->andWhere('e.user = :user')->setParameter('user', $params['user']) ; |
|
|
} |
|
|
} |