Browse Source

[Global] Bons cadeaux

feature/module_traiteur_v1
Fab 3 years ago
parent
commit
8c56bc7865
2 changed files with 4 additions and 2 deletions
  1. +1
    -2
      ShopBundle/Form/Frontend/SendGiftVoucherType.php
  2. +3
    -0
      ShopBundle/Repository/ReductionCreditRepository.php

+ 1
- 2
ShopBundle/Form/Frontend/SendGiftVoucherType.php View File

@@ -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 View File

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

Loading…
Cancel
Save