|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
$query = $this->findByMerchantQuery() ; |
|
|
$query = $this->findByMerchantQuery() ; |
|
|
|
|
|
|
|
|
|
|
|
if(isset($params['count']) && $params['count']) { |
|
|
|
|
|
$query->select('count(e.id)') ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if(isset($params['dateStart']) || isset($params['dateEnd'])) { |
|
|
if(isset($params['dateStart']) || isset($params['dateEnd'])) { |
|
|
$params['dateField'] = isset($params['dateField']) ? $params['dateField'] : 'validationDate' ; |
|
|
$params['dateField'] = isset($params['dateField']) ? $params['dateField'] : 'validationDate' ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$query->addOrderBy('deliverySlotPointSale.day', 'ASC') ; |
|
|
$query->addOrderBy('deliverySlotPointSale.day', 'ASC') ; |
|
|
$query->addOrderBy('deliverySlotPointSale.timeStart', 'ASC') ; |
|
|
$query->addOrderBy('deliverySlotPointSale.timeStart', 'ASC') ; |
|
|
|
|
|
|
|
|
return $query->getQuery()->getResult() ; |
|
|
|
|
|
|
|
|
if(isset($params['count']) && $params['count']) { |
|
|
|
|
|
return $query->getQuery()->getSingleScalarResult(); |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
return $query->getQuery()->getResult() ; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |