|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function filterOrderValid(?QueryBuilder $query): QueryBuilder |
|
|
public function filterOrderValid(?QueryBuilder $query): QueryBuilder |
|
|
{ |
|
|
{ |
|
|
$query->leftJoin('e.orderStatus', 'os'); |
|
|
|
|
|
$query->andWhere('os.alias IN (:alias)'); |
|
|
|
|
|
$query->setParameter('alias', OrderStatus::$statusAliasAsValid); |
|
|
|
|
|
|
|
|
return $this->_filterOrderStatus($query, OrderStatus::$statusAliasAsValid) ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return $query; |
|
|
|
|
|
|
|
|
public function filterOrderWaitingDelivery($query) |
|
|
|
|
|
{ |
|
|
|
|
|
return $this->_filterOrderStatus($query, OrderStatus::$statusAliasWaitingDelivery) ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function filterOrderCart($query) |
|
|
public function filterOrderCart($query) |
|
|
{ |
|
|
{ |
|
|
|
|
|
return $this->_filterOrderStatus($query, OrderStatus::$statusAliasAsCart) ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private function _filterOrderStatus($query, $statusArray) { |
|
|
$query->leftJoin('e.orderStatus', 'os'); |
|
|
$query->leftJoin('e.orderStatus', 'os'); |
|
|
$query->andWhere('os.alias IN (:alias)'); |
|
|
$query->andWhere('os.alias IN (:alias)'); |
|
|
$query->setParameter('alias', OrderStatus::$statusAliasAsCart); |
|
|
|
|
|
|
|
|
|
|
|
return $query; |
|
|
|
|
|
|
|
|
$query->setParameter('alias',$statusArray); |
|
|
|
|
|
return $query ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function findCartCurrent($params) |
|
|
public function findCartCurrent($params) |
|
|
|
|
|
|
|
|
$query = $this->filterOrderValid($query); |
|
|
$query = $this->filterOrderValid($query); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (isset($params['isWaitingDelivery'])) { |
|
|
|
|
|
$query = $this->filterOrderWaitingDelivery($query); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (isset($params['orderStatus'])) { |
|
|
if (isset($params['orderStatus'])) { |
|
|
$query->leftJoin('e.orderStatus', 'os'); |
|
|
$query->leftJoin('e.orderStatus', 'os'); |
|
|
$query->andWhere('os.alias LIKE :alias'); |
|
|
$query->andWhere('os.alias LIKE :alias'); |