Browse Source

[Global] Bons cadeaux

feature/module_traiteur_v1
Fab 4 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



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

+ 3
- 0
ShopBundle/Repository/ReductionCreditRepository.php View File

$query->andWhere('e.status = 1'); $query->andWhere('e.status = 1');
$query->andWhere('e.type = :type'); $query->andWhere('e.type = :type');
$query->andWhere(':user MEMBER OF e.users'); $query->andWhere(':user MEMBER OF e.users');
$query->andWhere(':now > e.activationDate');
$query->setParameter('now', new \DateTime()) ;

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

Loading…
Cancel
Save