Pārlūkot izejas kodu

Export par véhicules

feature/export_comptable
Fab pirms 4 gadiem
vecāks
revīzija
3b3f61579a
2 mainītis faili ar 22 papildinājumiem un 0 dzēšanām
  1. +19
    -0
      ShopBundle/Repository/OrderShopRepository.php
  2. +3
    -0
      ShopBundle/Services/CsvGenerator.php

+ 19
- 0
ShopBundle/Repository/OrderShopRepository.php Parādīt failu

@@ -120,6 +120,10 @@ class OrderShopRepository extends BaseRepository implements DefaultRepositoryInt
$query->select('count(e.id)');
}

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

if (isset($params['dateStart']) || isset($params['dateEnd'])) {
$params['dateField'] = isset($params['dateField']) ? $params['dateField'] : 'validationDate';
}
@@ -161,6 +165,17 @@ class OrderShopRepository extends BaseRepository implements DefaultRepositoryInt
$query->andWhere('e.deliveryAddress = :address OR e.invoiceAddress = :address')->setParameter('address', $params['address']);
}

if(isset($params['weekDeliveryTruck'])) {
$query->andWhere('e.weekDeliveryTruck = :weekDeliveryTruck')->setParameter('weekDeliveryTruck', $params['weekDeliveryTruck']);
}

if(isset($params['deliveryDate'])) {
$query->andWhere('e.deliveryDate >= :deliveryDateStart');
$query->andWhere('e.deliveryDate < :deliveryDateEnd');
$query->setParameter('deliveryDateStart', $params['deliveryDate']->format('Y-m-d 00:00:00'));
$query->setParameter('deliveryDateEnd', $params['deliveryDate']->modify('+1 day')->format('Y-m-d 00:00:00'));
}

if (isset($params['mergeComplementaryOrderShops'])) {
$query->andWhere('e.mainOrderShop IS NULL');
$query->leftJoin('e.complementaryOrderShops', 'complementaryOrderShops');
@@ -229,6 +244,10 @@ class OrderShopRepository extends BaseRepository implements DefaultRepositoryInt
}


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

if (isset($params['count']) && $params['count']) {
return $query->getQuery()->getSingleScalarResult();
} else {

+ 3
- 0
ShopBundle/Services/CsvGenerator.php Parādīt failu

@@ -45,4 +45,7 @@ class CsvGenerator






}

Notiek ielāde…
Atcelt
Saglabāt