Browse Source

Adaptations OrderShopStore

master
Guillaume 3 years ago
parent
commit
214c7ae6a3
2 changed files with 10 additions and 4 deletions
  1. +3
    -3
      Repository/Order/OrderShopRepositoryQuery.php
  2. +7
    -1
      Repository/Order/OrderShopStore.php

+ 3
- 3
Repository/Order/OrderShopRepositoryQuery.php View File

->setParameter('year', $year); ->setParameter('year', $year);
} }


public function filterByDistributions(array $distributions): self
public function filterByDistributions(array $distributionArray): self
{ {
return $this return $this
->andWhere('.distribution IN(:distributions)')
->setParameter('distributions', $distributions);
->andWhere('.distribution IN (:distributions)')
->setParameter('distributions', $distributionArray);
} }


public function filterByProducts(array $products): self public function filterByProducts(array $products): self

+ 7
- 1
Repository/Order/OrderShopStore.php View File



public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
{ {
$query->orderBy('id', 'DESC');
//$query->orderBy('id', 'DESC');
return $query; return $query;
} }


$query->filterByDistribution($params['distribution']); $query->filterByDistribution($params['distribution']);
} }


if (isset($params['distributions'])) {
$query->filterByDistributions($params['distributions']);
}

if (isset($params['isCart'])) { if (isset($params['isCart'])) {
$query->filterByStatus(OrderStatusModel::$statusAliasAsCart); $query->filterByStatus(OrderStatusModel::$statusAliasAsCart);
} }
if (isset($params['excludeComplementaryOrderShops']) || isset($params['mergeComplementaryOrderShops'])) { if (isset($params['excludeComplementaryOrderShops']) || isset($params['mergeComplementaryOrderShops'])) {
$query->filterIsNullMainOrderShop(); $query->filterIsNullMainOrderShop();
} }

if (isset($params['joinProductFamily'])) { if (isset($params['joinProductFamily'])) {
$query->joinProductFamily(true); $query->joinProductFamily(true);
} }
if (isset($params['groupBy'])) { if (isset($params['groupBy'])) {
$query->groupBy($params['groupBy']); $query->groupBy($params['groupBy']);
} }

return $query; return $query;
} }



Loading…
Cancel
Save