Skip to content

Commit

Permalink
Updated repository to show only active webinars in drop list (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
shinde-rahul committed Jan 31, 2024
1 parent 0fbc6dc commit 5c05da8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Entity/GoToProductRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace MauticPlugin\LeuchtfeuerGoToBundle\Entity;

use Doctrine\DBAL\Types\Types;
use Mautic\CoreBundle\Entity\CommonRepository;

class GoToProductRepository extends CommonRepository
Expand Down Expand Up @@ -81,11 +82,13 @@ public function getProductsBetweenSpecificDates($from = null, $to = null)
}

$qb = $this->createQueryBuilder('e');
$expr = $qb->expr();
$qb
->andWhere('e.date BETWEEN :from AND :to')
->andWhere($expr->eq('e.status', ':status'))
->setParameter('from', $from)
->setParameter('to', $to)
;
->setParameter('status', 'active', Types::STRING)
->setParameter('to', $to);

return $qb->getQuery()->getResult();
}
Expand Down

0 comments on commit 5c05da8

Please sign in to comment.