Skip to content

Commit

Permalink
Removed use of BETWEEN in query
Browse files Browse the repository at this point in the history
  • Loading branch information
juniwalk committed Oct 12, 2022
1 parent e558ad5 commit a7421f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Chronicler.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ public function isRecorded(Record $record, string $period = null): bool
$dateEnd = new DateTime('-'.Strings::trim($period, '+-'));
$dateStart = new DateTime;

$qb->andWhere('e.date BETWEEN :dateStart AND :dateEnd')
->setParameter('dateStart', $dateStart->setTime(0, 0, 0))
->setParameter('dateEnd', $dateEnd->setTime(23, 59, 59));
$qb->andWhere('e.date < :dateStart AND e.date > :dateEnd')
->setParameter('dateStart', $dateStart->setTime(23, 59, 59))
->setParameter('dateEnd', $dateEnd->setTime(0, 0, 0));
});

return $result instanceof Record;
Expand Down

0 comments on commit a7421f4

Please sign in to comment.