Feat: Implement destination autocompletion by date
This commit is contained in:
@@ -30,11 +30,12 @@ class DestinationRepository extends ServiceEntityRepository
|
||||
|
||||
$dates = $qb
|
||||
->where($qb->expr()->orX(
|
||||
$qb->expr()->like('destination.product', ':product'),
|
||||
$qb->expr()->like('destination.hotel', ':hotel')
|
||||
$qb->expr()->like('destination.product', ':search'),
|
||||
$qb->expr()->like('destination.hotel', ':search'),
|
||||
$qb->expr()->like('DATE_FORMAT(destination.dateFrom, \'%d.%m.%y\')', ':search'),
|
||||
$qb->expr()->like('DATE_FORMAT(destination.dateTo, \'%d.%m.%y\')', ':search')
|
||||
))
|
||||
->setParameter('product', '%'.$this->escapeLikeWildcards($search).'%')
|
||||
->setParameter('hotel', '%'.$this->escapeLikeWildcards($search).'%')
|
||||
->setParameter('search', '%'.$this->escapeLikeWildcards($search).'%')
|
||||
->orderBy('destination.dateFrom', 'ASC')
|
||||
->addOrderBy('destination.product', 'ASC')
|
||||
->getQuery()
|
||||
|
||||
Reference in New Issue
Block a user