Ver código fonte

OrderShopRepository : ajout orderBy

feature/export_comptable
Guillaume 4 anos atrás
pai
commit
f4aea61836
3 arquivos alterados com 21 adições e 10 exclusões
  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 Ver arquivo

@@ -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 Ver arquivo

@@ -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 Ver arquivo

@@ -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() ;
}


Carregando…
Cancelar
Salvar