|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Lc\ShopBundle\Repository; |
|
|
namespace Lc\ShopBundle\Repository; |
|
|
|
|
|
|
|
|
|
|
|
use App\Entity\DeliveryAvailabilityPointSale; |
|
|
|
|
|
use App\Entity\DeliveryAvailabilityZone; |
|
|
use Doctrine\ORM\QueryBuilder; |
|
|
use Doctrine\ORM\QueryBuilder; |
|
|
use Lc\ShopBundle\Context\DefaultRepositoryInterface; |
|
|
use Lc\ShopBundle\Context\DefaultRepositoryInterface; |
|
|
use Lc\ShopBundle\Context\OrderShopInterface; |
|
|
use Lc\ShopBundle\Context\OrderShopInterface; |
|
|
|
|
|
|
|
|
$query->andWhere('pointSale.isDepository = 1'); |
|
|
$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'])) { |
|
|
if (isset($params['orderBy'])) { |
|
|
$query->orderBy('e.' . $params['orderBy'], isset($params['orderByDirection']) ? $params['orderByDirection'] : 'DESC'); |
|
|
$query->orderBy('e.' . $params['orderBy'], isset($params['orderByDirection']) ? $params['orderByDirection'] : 'DESC'); |
|
|
} else { |
|
|
} else { |