->andWhere('.mainOrderShop IS NULL'); | ->andWhere('.mainOrderShop IS NULL'); | ||||
} | } | ||||
public function filterMinimumTomorrowDelivery(): self | |||||
{ | |||||
return $this->andWhere('.deliveryDate > :today')->setParameter('today', (new DateTime())->setTime(23, 59)); | |||||
} | |||||
public function selectOrderReductionCarts(): self | public function selectOrderReductionCarts(): self | ||||
{ | { | ||||
$this->joinOrderReductionCarts(); | $this->joinOrderReductionCarts(); |
$query->filterByAddress($params['address']); | $query->filterByAddress($params['address']); | ||||
} | } | ||||
if(isset($params['minimumTomorrowDelivery'])) { | |||||
$query->filterMinimumTomorrowDelivery(); | |||||
} | |||||
if (isset($params['mergeComplementaryOrderShops'])) { | if (isset($params['mergeComplementaryOrderShops'])) { | ||||
$query | $query | ||||
->joinComplementaryOrderShops(); | ->joinComplementaryOrderShops(); |
public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | ||||
{ | { | ||||
$query->filterBySection($this->section); | |||||
$this->addFilterBySectionOptionnal($query); | |||||
return $query; | return $query; | ||||
} | } | ||||