Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $result = $this->entityManager->createQueryBuilder()
- ->select('ac')
- ->from('AppBundle:ActivationCode', 'ac')
- ->leftJoin('ac.user', 'u')
- ->where('ac.status = :statusActive')
- ->setParameter('statusActive', 1)
- ->andWhere("ac.expireAt > :dateNow AND :dateNow BETWEEN DATE_SUB(ac.expireAt, :firstRemindDaysToExpirationMinusOne, 'day') AND DATE_SUB(ac.expireAt, :firstRemindDaysToExpiration, 'day')")
- ->andWhere("ac.expireAt > :dateNow AND :dateNow BETWEEN DATE_SUB(ac.expireAt, :secondRemindDaysToExpirationMinusOne, 'day') AND DATE_SUB(ac.expireAt, :secondRemindDaysToExpiration, 'day')")
- ->setParameter('dateNow', $now)
- ->setParameter('firstRemindDaysToExpiration', self::FIRST_REMIND_DAYS_TO_EXPIRATION)
- ->setParameter('firstRemindDaysToExpirationMinusOne', self::FIRST_REMIND_DAYS_TO_EXPIRATION - 1)
- ->setParameter('secondRemindDaysToExpiration', self::SECOND_REMIND_DAYS_TO_EXPIRATION)
- ->setParameter('secondRemindDaysToExpirationMinusOne', self::SECOND_REMIND_DAYS_TO_EXPIRATION - 1)
- ->getQuery()
- ->getResult();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement