|
|
@@ -4,12 +4,11 @@ namespace Lc\CaracoleBundle\Repository\Order; |
|
|
|
|
|
|
|
use App\Builder\Distribution\DistributionBuilder; |
|
|
|
use App\Entity\Distribution\Distribution; |
|
|
|
use App\Entity\User\User; |
|
|
|
use App\Entity\Order\OrderStatus; |
|
|
|
use Doctrine\ORM\EntityManagerInterface; |
|
|
|
use Lc\CaracoleBundle\Builder\File\DocumentBuilder; |
|
|
|
use Lc\CaracoleBundle\Model\Distribution\DistributionInterface; |
|
|
|
use Lc\CaracoleBundle\Model\Order\OrderShopInterface; |
|
|
|
use Lc\CaracoleBundle\Model\Order\OrderStatusModel; |
|
|
|
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; |
|
|
|
use Lc\CaracoleBundle\Model\Product\ProductInterface; |
|
|
|
use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface; |
|
|
@@ -272,7 +271,7 @@ class OrderShopStore extends AbstractStore |
|
|
|
$query |
|
|
|
->selectCount() |
|
|
|
->filterByReductionCredit($reductionCredit) |
|
|
|
->filterByStatus(OrderStatusModel::$statusAliasAsValid); |
|
|
|
->filterByStatus(OrderStatus::$statusAliasAsValid); |
|
|
|
|
|
|
|
return $query->count(); |
|
|
|
} |
|
|
@@ -288,7 +287,7 @@ class OrderShopStore extends AbstractStore |
|
|
|
$query |
|
|
|
->selectCount() |
|
|
|
->filterByReductionCart($reductionCart) |
|
|
|
->filterByStatus(OrderStatusModel::$statusAliasAsValid); |
|
|
|
->filterByStatus(OrderStatus::$statusAliasAsValid); |
|
|
|
|
|
|
|
return $query->count(); |
|
|
|
} |
|
|
@@ -306,7 +305,7 @@ class OrderShopStore extends AbstractStore |
|
|
|
->selectCount() |
|
|
|
->filterByUser($user) |
|
|
|
->filterByReductionCart($reductionCart) |
|
|
|
->filterByStatus(OrderStatusModel::$statusAliasAsValid); |
|
|
|
->filterByStatus(OrderStatus::$statusAliasAsValid); |
|
|
|
|
|
|
|
return $query->count(); |
|
|
|
} |
|
|
@@ -343,7 +342,7 @@ class OrderShopStore extends AbstractStore |
|
|
|
|
|
|
|
$query |
|
|
|
->selectOrderReductionCarts() |
|
|
|
->filterByStatus(OrderStatusModel::$statusAliasAsCart); |
|
|
|
->filterByStatus(OrderStatus::$statusAliasAsCart); |
|
|
|
|
|
|
|
return $query->findOne(); |
|
|
|
} |
|
|
@@ -359,7 +358,7 @@ class OrderShopStore extends AbstractStore |
|
|
|
|
|
|
|
$query |
|
|
|
->filterByDistribution($distribution) |
|
|
|
->filterByStatus(OrderStatusModel::$statusAliasAsValid) |
|
|
|
->filterByStatus(OrderStatus::$statusAliasAsValid) |
|
|
|
->filterIsNotComplementaryOrderShop() |
|
|
|
->orderBy('.cycleId', 'DESC'); |
|
|
|
|
|
|
@@ -377,7 +376,7 @@ class OrderShopStore extends AbstractStore |
|
|
|
$query |
|
|
|
->filterByDistribution($distribution) |
|
|
|
->filterByUser($user) |
|
|
|
->filterByStatus(OrderStatusModel::$statusAliasAsValid) |
|
|
|
->filterByStatus(OrderStatus::$statusAliasAsValid) |
|
|
|
->filterIsNotComplementaryOrderShop() |
|
|
|
->orderBy('.cycleId', 'DESC'); |
|
|
|
|
|
|
@@ -390,7 +389,7 @@ class OrderShopStore extends AbstractStore |
|
|
|
$query = $this->createDefaultQuery($query); |
|
|
|
|
|
|
|
$query |
|
|
|
->filterByStatus(OrderStatusModel::$statusAliasAsValid) |
|
|
|
->filterByStatus(OrderStatus::$statusAliasAsValid) |
|
|
|
->filterIsNotComplementaryOrderShop() |
|
|
|
->orderBy('.idValidOrder', 'DESC'); |
|
|
|
|
|
|
@@ -466,15 +465,15 @@ class OrderShopStore extends AbstractStore |
|
|
|
} |
|
|
|
|
|
|
|
if (isset($params['isCart'])) { |
|
|
|
$query->filterByStatus(OrderStatusModel::$statusAliasAsCart); |
|
|
|
$query->filterByStatus(OrderStatus::$statusAliasAsCart); |
|
|
|
} |
|
|
|
|
|
|
|
if (isset($params['isValid'])) { |
|
|
|
$query->filterByStatus(OrderStatusModel::$statusAliasAsValid); |
|
|
|
$query->filterByStatus(OrderStatus::$statusAliasAsValid); |
|
|
|
} |
|
|
|
|
|
|
|
if (isset($params['isWaitingDelivery'])) { |
|
|
|
$query->filterByStatus(OrderStatusModel::$statusAliasWaitingDelivery); |
|
|
|
$query->filterByStatus(OrderStatus::$statusAliasWaitingDelivery); |
|
|
|
} |
|
|
|
|
|
|
|
if (isset($params['orderStatus'])) { |
|
|
@@ -656,7 +655,7 @@ class OrderShopStore extends AbstractStore |
|
|
|
{ |
|
|
|
$query = $this->createDefaultQuery($query); |
|
|
|
$query |
|
|
|
->filterByAlias(OrderStatusModel::$statusAliasAsValid) |
|
|
|
->filterByAlias(OrderStatus::$statusAliasAsValid) |
|
|
|
->filterByDistributions($distributions) |
|
|
|
->filterByProducts($products) |
|
|
|
->selectSum() |
|
|
@@ -678,7 +677,7 @@ class OrderShopStore extends AbstractStore |
|
|
|
$query = $this->createQuery($query); |
|
|
|
|
|
|
|
$query |
|
|
|
->filterByAlias(OrderStatusModel::$statusAliasAsValid) |
|
|
|
->filterByAlias(OrderStatus::$statusAliasAsValid) |
|
|
|
->filterByDistribution($distribution) |
|
|
|
->filterByProduct($product) |
|
|
|
->selectSumQuantityOrder() |
|
|
@@ -730,7 +729,7 @@ class OrderShopStore extends AbstractStore |
|
|
|
|
|
|
|
$query = $this->createQuery($query); |
|
|
|
|
|
|
|
$query->filterByAlias(OrderStatusModel::$statusAliasAsCart); |
|
|
|
$query->filterByAlias(OrderStatus::$statusAliasAsCart); |
|
|
|
$query->filterByUserIsNull(); |
|
|
|
$query->filterByVisitorIsNull(); |
|
|
|
|