|
|
@@ -2,6 +2,8 @@ |
|
|
|
|
|
|
|
namespace Lc\ShopBundle\Repository; |
|
|
|
|
|
|
|
use App\Entity\DeliveryAvailabilityPointSale; |
|
|
|
use App\Entity\DeliveryAvailabilityZone; |
|
|
|
use Doctrine\ORM\QueryBuilder; |
|
|
|
use Lc\ShopBundle\Context\DefaultRepositoryInterface; |
|
|
|
use Lc\ShopBundle\Context\OrderShopInterface; |
|
|
@@ -181,6 +183,21 @@ class OrderShopRepository extends BaseRepository implements DefaultRepositoryInt |
|
|
|
$query->andWhere('pointSale.isDepository = 1'); |
|
|
|
} |
|
|
|
|
|
|
|
if (isset($params['deliveryAvailability'])) { |
|
|
|
$deliveryAvailability = $params['deliveryAvailability'] ; |
|
|
|
|
|
|
|
$isDeliveryAvailabilityZone = ($deliveryAvailability instanceof DeliveryAvailabilityZone) ? true : false; |
|
|
|
$isDeliveryAvailabilityPointSale = ($deliveryAvailability instanceof DeliveryAvailabilityPointSale) ? true : false; |
|
|
|
|
|
|
|
if($isDeliveryAvailabilityZone) { |
|
|
|
$query->innerJoin('e.deliveryAvailabilityZone','deliveryAvailabilityZone') ; |
|
|
|
} |
|
|
|
|
|
|
|
if($isDeliveryAvailabilityPointSale) { |
|
|
|
$query->innerJoin('e.deliveryAvailabilityPointSale','deliveryAvailabilityPointSale') ; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (isset($params['orderBy'])) { |
|
|
|
$query->orderBy('e.' . $params['orderBy'], isset($params['orderByDirection']) ? $params['orderByDirection'] : 'DESC'); |
|
|
|
} else { |