|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$setParameterHorsTournee = false ; |
|
|
$setParameterHorsTournee = false ; |
|
|
|
|
|
$setParameterGiftVoucher = false ; |
|
|
|
|
|
|
|
|
if (isset($params['isCircuit'])) { |
|
|
|
|
|
|
|
|
if(isset($params['isCircuit'])) { |
|
|
$query->leftJoin('e.deliveryPointSale', 'pointSale'); |
|
|
$query->leftJoin('e.deliveryPointSale', 'pointSale'); |
|
|
$query->andWhere('e.deliveryPointSale IS NULL OR (pointSale.isDepository = 0 AND (pointSale.devAlias IS NULL OR pointSale.devAlias != :devAliasHorsTournee))'); |
|
|
|
|
|
|
|
|
$query->andWhere('e.deliveryPointSale IS NULL OR (pointSale.isDepository = 0 AND (pointSale.devAlias IS NULL OR (pointSale.devAlias != :devAliasHorsTournee AND pointSale.devAlias != :devAliasGiftVoucher)))'); |
|
|
$setParameterHorsTournee = true ; |
|
|
$setParameterHorsTournee = true ; |
|
|
|
|
|
$setParameterGiftVoucher = true ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (isset($params['isDepository'])) { |
|
|
|
|
|
|
|
|
if(isset($params['isDepository'])) { |
|
|
$query->innerJoin('e.deliveryPointSale', 'pointSale'); |
|
|
$query->innerJoin('e.deliveryPointSale', 'pointSale'); |
|
|
$query->andWhere('pointSale IS NOT NULL AND pointSale.isDepository = 1 AND (pointSale.devAlias IS NULL OR pointSale.devAlias != :devAliasHorsTournee)'); |
|
|
|
|
|
|
|
|
$query->andWhere('pointSale IS NOT NULL AND pointSale.isDepository = 1 AND (pointSale.devAlias IS NULL OR (pointSale.devAlias != :devAliasHorsTournee AND pointSale.devAlias != :devAliasGiftVoucher))'); |
|
|
$setParameterHorsTournee = true ; |
|
|
$setParameterHorsTournee = true ; |
|
|
|
|
|
$setParameterGiftVoucher = true ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (isset($params['isOffCircuit'])) { |
|
|
|
|
|
|
|
|
if(isset($params['isOffCircuit'])) { |
|
|
$query->innerJoin('e.deliveryPointSale', 'pointSale'); |
|
|
$query->innerJoin('e.deliveryPointSale', 'pointSale'); |
|
|
$query->andWhere('pointSale IS NOT NULL AND pointSale.devAlias = :devAliasHorsTournee'); |
|
|
$query->andWhere('pointSale IS NOT NULL AND pointSale.devAlias = :devAliasHorsTournee'); |
|
|
$setParameterHorsTournee = true ; |
|
|
$setParameterHorsTournee = true ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(isset($params['isGiftVoucher'])) { |
|
|
|
|
|
$query->innerJoin('e.deliveryPointSale', 'pointSale'); |
|
|
|
|
|
$query->andWhere('pointSale IS NOT NULL AND pointSale.devAlias = :devAliasGiftVoucher'); |
|
|
|
|
|
$setParameterGiftVoucher = true ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if($setParameterHorsTournee) { |
|
|
if($setParameterHorsTournee) { |
|
|
$query->setParameter('devAliasHorsTournee', 'horstournee') ; |
|
|
$query->setParameter('devAliasHorsTournee', 'horstournee') ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if($setParameterGiftVoucher) { |
|
|
|
|
|
$query->setParameter('devAliasGiftVoucher', 'giftvoucher') ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (isset($params['deliveryAvailability'])) { |
|
|
if (isset($params['deliveryAvailability'])) { |
|
|
$deliveryAvailability = $params['deliveryAvailability'] ; |
|
|
$deliveryAvailability = $params['deliveryAvailability'] ; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$query->orderBy('e.id', 'DESC'); |
|
|
$query->orderBy('e.id', 'DESC'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isset($params['groupBy'])) { |
|
|
if (isset($params['groupBy'])) { |
|
|
$query->groupBy( $params['groupBy']); |
|
|
$query->groupBy( $params['groupBy']); |
|
|
} |
|
|
} |