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