@@ -152,11 +152,11 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery | |||
->setParameter('year', $year); | |||
} | |||
public function filterByDistributions(array $distributions): self | |||
public function filterByDistributions(array $distributionArray): self | |||
{ | |||
return $this | |||
->andWhere('.distribution IN(:distributions)') | |||
->setParameter('distributions', $distributions); | |||
->andWhere('.distribution IN (:distributions)') | |||
->setParameter('distributions', $distributionArray); | |||
} | |||
public function filterByProducts(array $products): self |
@@ -89,7 +89,7 @@ class OrderShopStore extends AbstractStore | |||
public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||
{ | |||
$query->orderBy('id', 'DESC'); | |||
//$query->orderBy('id', 'DESC'); | |||
return $query; | |||
} | |||
@@ -392,6 +392,10 @@ class OrderShopStore extends AbstractStore | |||
$query->filterByDistribution($params['distribution']); | |||
} | |||
if (isset($params['distributions'])) { | |||
$query->filterByDistributions($params['distributions']); | |||
} | |||
if (isset($params['isCart'])) { | |||
$query->filterByStatus(OrderStatusModel::$statusAliasAsCart); | |||
} | |||
@@ -428,6 +432,7 @@ class OrderShopStore extends AbstractStore | |||
if (isset($params['excludeComplementaryOrderShops']) || isset($params['mergeComplementaryOrderShops'])) { | |||
$query->filterIsNullMainOrderShop(); | |||
} | |||
if (isset($params['joinProductFamily'])) { | |||
$query->joinProductFamily(true); | |||
} | |||
@@ -442,6 +447,7 @@ class OrderShopStore extends AbstractStore | |||
if (isset($params['groupBy'])) { | |||
$query->groupBy($params['groupBy']); | |||
} | |||
return $query; | |||
} | |||
@@ -13,7 +13,7 @@ class UnitSolver | |||
if($quantity) { | |||
return ($quantityProduct / $unit->getCoefficient()) * $quantity; | |||
}else{ | |||
$quantity = 0; | |||
return 0; | |||
} | |||
} | |||
@@ -345,6 +345,14 @@ class OrderShopSolver | |||
return false; | |||
} | |||
public function isDone(OrderShopInterface $orderShop): bool | |||
{ | |||
if ($orderShop->getOrderStatus() && $orderShop->getOrderStatus()->getAlias() == OrderStatusModel::ALIAS_DONE ) { | |||
return true; | |||
} | |||
return false; | |||
} | |||
// getProductQuantityMaxAddCart | |||
public function getProductQuantityMaxAddCart(OrderShopInterface $orderShop, ProductInterface $product) | |||
{ |