Browse Source

OrderShopRepository : ajout orderBy

feature/export_comptable
Guillaume 4 years ago
parent
commit
f4aea61836
3 changed files with 21 additions and 10 deletions
  1. +10
    -10
      ShopBundle/Form/Backend/Common/AddressType.php
  2. +1
    -0
      ShopBundle/Model/Address.php
  3. +10
    -0
      ShopBundle/Repository/OrderShopRepository.php

+ 10
- 10
ShopBundle/Form/Backend/Common/AddressType.php View File

@@ -43,16 +43,16 @@ class AddressType extends AbstractType
'Homme' => 0,
],
])
->add('lastname', TextType::class, ['label' => 'Nom', 'required' => false])
->add('firstname', TextType::class, ['label' => 'Prénom', 'required' => false])
->add('address', TextareaType::class, ['label' => 'Adresse'])
->add('zip', TextType::class, ['label' => 'Code postale'])
->add('city', TextType::class, ['label' => 'Ville'])
->add('country', TextType::class, ['label' => 'Pays'])
->add('phone', TextType::class, ['label' => 'Téléphone', 'required' => false])
->add('company', TextType::class, ['label' => 'Entreprise', 'required' => false])
->add('siret', TextType::class, ['label' => 'SIRET', 'required' => false])
->add('tva', TextType::class, ['label' => 'Numéro TVA', 'required' => false]);
->add('lastname', TextType::class, ['required' => false])
->add('firstname', TextType::class, ['required' => false])
->add('address', TextareaType::class)
->add('zip', TextType::class)
->add('city', TextType::class)
->add('country', TextType::class)
->add('phone', TextType::class, ['required' => false])
->add('company', TextType::class, ['required' => false])
->add('siret', TextType::class, ['required' => false])
->add('tva', TextType::class, ['required' => false]);
}

public function configureOptions(OptionsResolver $resolver)

+ 1
- 0
ShopBundle/Model/Address.php View File

@@ -100,6 +100,7 @@ abstract class Address extends AbstractEntity
*/
protected $deliveryInfos;


public function __toString()
{
return $this->getTitle() . ' - ' . $this->getZip() . ' ' . $this->getCity();

+ 10
- 0
ShopBundle/Repository/OrderShopRepository.php View File

@@ -101,6 +101,16 @@ class OrderShopRepository extends BaseRepository implements DefaultRepositoryInt

$this->filterOrderCart($query) ;

$query->leftJoin('e.deliveryAvailabilityZone', 'deliveryAvailabilityZone') ;
$query->leftJoin('deliveryAvailabilityZone.deliverySlot', 'deliverySlotZone') ;
$query->addOrderBy('deliverySlotZone.day', 'ASC') ;
$query->addOrderBy('deliverySlotZone.timeStart', 'ASC') ;

$query->leftJoin('e.deliveryAvailabilityPointSale', 'deliveryAvailabilityPointSale') ;
$query->leftJoin('deliveryAvailabilityPointSale.deliverySlot', 'deliverySlotPointSale') ;
$query->addOrderBy('deliverySlotPointSale.day', 'ASC') ;
$query->addOrderBy('deliverySlotPointSale.timeStart', 'ASC') ;

return $query->getQuery()->getResult() ;
}


Loading…
Cancel
Save