|
|
@@ -186,16 +186,25 @@ class OrderShopRepository extends BaseRepository implements DefaultRepositoryInt |
|
|
|
if (isset($params['deliveryAvailability'])) { |
|
|
|
$deliveryAvailability = $params['deliveryAvailability'] ; |
|
|
|
|
|
|
|
$isDeliveryAvailabilityZone = ($deliveryAvailability instanceof DeliveryAvailabilityZone) ? true : false; |
|
|
|
$isDeliveryAvailabilityPointSale = ($deliveryAvailability instanceof DeliveryAvailabilityPointSale) ? true : false; |
|
|
|
$deliveryAvailabilityZone = ($deliveryAvailability instanceof DeliveryAvailabilityZone) ? $deliveryAvailability : false; |
|
|
|
$deliveryAvailabilityPointSale = ($deliveryAvailability instanceof DeliveryAvailabilityPointSale) ? $deliveryAvailability : false; |
|
|
|
|
|
|
|
if($isDeliveryAvailabilityZone) { |
|
|
|
$query->innerJoin('e.deliveryAvailabilityZone','deliveryAvailabilityZone') ; |
|
|
|
if($deliveryAvailabilityZone){ |
|
|
|
$query->andWhere('e.deliveryAvailabilityZone = :deliveryAvailabilityZone'); |
|
|
|
$query->setParameter('deliveryAvailabilityZone', $deliveryAvailabilityZone); |
|
|
|
} |
|
|
|
|
|
|
|
if($isDeliveryAvailabilityPointSale) { |
|
|
|
$query->innerJoin('e.deliveryAvailabilityPointSale','deliveryAvailabilityPointSale') ; |
|
|
|
if($deliveryAvailabilityPointSale) { |
|
|
|
$query->andWhere('e.deliveryAvailabilityZone = :deliveryAvailabilityZone'); |
|
|
|
$query->setParameter('deliveryAvailabilityZone', $deliveryAvailabilityPointSale); |
|
|
|
} |
|
|
|
|
|
|
|
}else{ |
|
|
|
$query->leftJoin('e.deliveryAvailabilityZone', 'deliveryAvailabilityZone'); |
|
|
|
$query->leftJoin('deliveryAvailabilityZone.deliverySlot', 'deliverySlotZone'); |
|
|
|
|
|
|
|
$query->leftJoin('e.deliveryAvailabilityPointSale', 'deliveryAvailabilityPointSale'); |
|
|
|
$query->leftJoin('deliveryAvailabilityPointSale.deliverySlot', 'deliverySlotPointSale'); |
|
|
|
} |
|
|
|
|
|
|
|
if (isset($params['orderBy'])) { |
|
|
@@ -204,11 +213,6 @@ class OrderShopRepository extends BaseRepository implements DefaultRepositoryInt |
|
|
|
$query->orderBy('e.id', 'DESC'); |
|
|
|
} |
|
|
|
|
|
|
|
$query->leftJoin('e.deliveryAvailabilityZone', 'deliveryAvailabilityZone'); |
|
|
|
$query->leftJoin('deliveryAvailabilityZone.deliverySlot', 'deliverySlotZone'); |
|
|
|
|
|
|
|
$query->leftJoin('e.deliveryAvailabilityPointSale', 'deliveryAvailabilityPointSale'); |
|
|
|
$query->leftJoin('deliveryAvailabilityPointSale.deliverySlot', 'deliverySlotPointSale'); |
|
|
|
|
|
|
|
if (isset($params['count']) && $params['count']) { |
|
|
|
return $query->getQuery()->getSingleScalarResult(); |