Bläddra i källkod

[Global] Bons cadeaux

feature/module_traiteur_v1
Fab 3 år sedan
förälder
incheckning
8c56bc7865
2 ändrade filer med 4 tillägg och 2 borttagningar
  1. +1
    -2
      ShopBundle/Form/Frontend/SendGiftVoucherType.php
  2. +3
    -0
      ShopBundle/Repository/ReductionCreditRepository.php

+ 1
- 2
ShopBundle/Form/Frontend/SendGiftVoucherType.php Visa fil

@@ -32,8 +32,7 @@ class SendGiftVoucherType extends AbstractType

$builder->add('activationDate', DateType::class, [
'label' => 'Date d\'activation de votre bon cadeau',
'widget'=> 'single_text',
'mapped'=> false,
'widget'=> 'single_text'
])
->add('title', TextType::class, [
'label' => 'Nom de votre bon cadeau'

+ 3
- 0
ShopBundle/Repository/ReductionCreditRepository.php Visa fil

@@ -39,6 +39,9 @@ class ReductionCreditRepository extends BaseRepository implements DefaultReposit
$query->andWhere('e.status = 1');
$query->andWhere('e.type = :type');
$query->andWhere(':user MEMBER OF e.users');
$query->andWhere(':now > e.activationDate');
$query->setParameter('now', new \DateTime()) ;

$query->setParameter('user', $user);
$query->setParameter('type', ReductionCredit::TYPE_GIFT);
return $query->getQuery()->getResult() ;

Laddar…
Avbryt
Spara