Browse Source

[Frontend] Recherche : recherche dans le titre de la catégorie

feature/tableau_edition_avancee
Guillaume 4 years ago
parent
commit
0035644539
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      ShopBundle/Repository/ProductFamilyRepository.php

+ 3
- 1
ShopBundle/Repository/ProductFamilyRepository.php View File

$query = $this->joinRelations($query) ; $query = $this->joinRelations($query) ;


$query->andWhere('e.status = 1'); $query->andWhere('e.status = 1');
$query->andWhere('e.title LIKE :terms');
$query->andWhere('e.title LIKE :terms OR cat.title LIKE :terms');
$query->setParameter(':terms', '%'.$terms.'%') ; $query->setParameter(':terms', '%'.$terms.'%') ;


$query->groupBy('e.id') ;

if($maxResults) { if($maxResults) {
$query->setMaxResults($maxResults) ; $query->setMaxResults($maxResults) ;
} }

Loading…
Cancel
Save