update
This commit is contained in:
@@ -24,14 +24,12 @@ class TaskSchemaRepository extends ServiceEntityRepository
|
||||
public function findActiveSchemasInRange(\DateTimeInterface $from, \DateTimeInterface $to): array
|
||||
{
|
||||
return $this->createQueryBuilder('t')
|
||||
->where('t.status != :excluded')
|
||||
->andWhere(
|
||||
'(t.taskType = :einzel AND (t.deadline IS NULL OR (t.deadline >= :from AND t.deadline <= :to)))'
|
||||
. ' OR '
|
||||
. '(t.taskType != :einzel AND t.startDate <= :to AND (t.endDate IS NULL OR t.endDate >= :from))'
|
||||
)
|
||||
->setParameter('excluded', TaskSchemaStatus::Inactive)
|
||||
->setParameter('einzel', TaskSchemaType::Single->value)
|
||||
->where('t.status = :active')
|
||||
->andWhere('t.taskType IN (:types)')
|
||||
->andWhere('t.startDate <= :to')
|
||||
->andWhere('t.endDate IS NULL OR t.endDate >= :from')
|
||||
->setParameter('active', TaskSchemaStatus::Active)
|
||||
->setParameter('types', [TaskSchemaType::Daily, TaskSchemaType::Custom])
|
||||
->setParameter('from', $from)
|
||||
->setParameter('to', $to)
|
||||
->getQuery()
|
||||
|
||||
Reference in New Issue
Block a user