|
|
@@ -81,17 +81,6 @@ class OrderShopRepository extends BaseRepository implements DefaultRepositoryInt |
|
|
|
return $query; |
|
|
|
} |
|
|
|
|
|
|
|
public function filterIsOffCircuit($query, $isOffCircuit) |
|
|
|
{ |
|
|
|
if ($isOffCircuit) { |
|
|
|
$query->andWhere('e.isOffCircuit = 1'); |
|
|
|
} else { |
|
|
|
$query->andWhere('e.isOffCircuit IS NULL OR e.isOffCircuit = 0'); |
|
|
|
} |
|
|
|
|
|
|
|
return $query; |
|
|
|
} |
|
|
|
|
|
|
|
public function findCartCurrent($params) |
|
|
|
{ |
|
|
|
$query = $this->findByMerchantQuery(); |
|
|
@@ -177,20 +166,28 @@ class OrderShopRepository extends BaseRepository implements DefaultRepositoryInt |
|
|
|
$query->andWhere('e.mainOrderShop IS NULL'); |
|
|
|
} |
|
|
|
|
|
|
|
if (isset($params['isOffCircuit'])) { |
|
|
|
$query = $this->filterIsOffCircuit($query, true); |
|
|
|
} |
|
|
|
$setParameterHorsTournee = false ; |
|
|
|
|
|
|
|
if (isset($params['isCircuit'])) { |
|
|
|
$query = $this->filterIsOffCircuit($query, false); |
|
|
|
$query->leftJoin('e.deliveryPointSale', 'pointSale'); |
|
|
|
$query->andWhere('e.deliveryPointSale IS NULL OR pointSale.isDepository = 0'); |
|
|
|
$query->andWhere('e.deliveryPointSale IS NULL OR (pointSale.isDepository = 0 AND (pointSale.devAlias IS NULL OR pointSale.devAlias != :devAliasHorsTournee))'); |
|
|
|
$setParameterHorsTournee = true ; |
|
|
|
} |
|
|
|
|
|
|
|
if (isset($params['isDepository'])) { |
|
|
|
$query = $this->filterIsOffCircuit($query, false); |
|
|
|
$query->innerJoin('e.deliveryPointSale', 'pointSale'); |
|
|
|
$query->andWhere('pointSale.isDepository = 1'); |
|
|
|
$query->andWhere('pointSale IS NOT NULL AND pointSale.isDepository = 1 AND (pointSale.devAlias IS NULL OR pointSale.devAlias != :devAliasHorsTournee)'); |
|
|
|
$setParameterHorsTournee = true ; |
|
|
|
} |
|
|
|
|
|
|
|
if (isset($params['isOffCircuit'])) { |
|
|
|
$query->innerJoin('e.deliveryPointSale', 'pointSale'); |
|
|
|
$query->andWhere('pointSale IS NOT NULL AND pointSale.devAlias = :devAliasHorsTournee'); |
|
|
|
$setParameterHorsTournee = true ; |
|
|
|
} |
|
|
|
|
|
|
|
if($setParameterHorsTournee) { |
|
|
|
$query->setParameter('devAliasHorsTournee', 'horstournee') ; |
|
|
|
} |
|
|
|
|
|
|
|
if (isset($params['deliveryAvailability'])) { |