mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fixed: fix date's type in DateType input, and prevent collision on
parameter name
This commit is contained in:
parent
abd79df8cd
commit
d6b358cfa1
@ -15,7 +15,7 @@ use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\UserHistory;
|
||||
use Chill\PersonBundle\Export\Declarations;
|
||||
use DateTime;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
@ -33,15 +33,15 @@ class HasNoReferrerFilter implements FilterInterface
|
||||
->andWhere('
|
||||
NOT EXISTS (
|
||||
SELECT 1 FROM ' . UserHistory::class . ' uh
|
||||
WHERE uh.startDate < :date
|
||||
WHERE uh.startDate <= :has_no_referrer_filter_date
|
||||
AND (
|
||||
uh.endDate IS NULL
|
||||
or uh.endDate > :date
|
||||
or uh.endDate > :has_no_referrer_filter_date
|
||||
)
|
||||
AND uh.accompanyingPeriod = acp
|
||||
)
|
||||
')
|
||||
->setParameter('date', $data['calc_date'], Types::DATE_IMMUTABLE);
|
||||
->setParameter('has_no_referrer_filter_date', $data['calc_date'], Types::DATE_IMMUTABLE);
|
||||
}
|
||||
|
||||
public function applyOn(): string
|
||||
@ -54,7 +54,8 @@ class HasNoReferrerFilter implements FilterInterface
|
||||
$builder
|
||||
->add('calc_date', ChillDateType::class, [
|
||||
'label' => 'Has no referrer on this date',
|
||||
'data' => new DateTime(),
|
||||
'data' => new DateTimeImmutable(),
|
||||
'input' => 'datetime_immutable',
|
||||
]);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user