|
|
|
|
|
|
|
|
public function findByTerms($terms, $maxResults = false) |
|
|
public function findByTerms($terms, $maxResults = false) |
|
|
{ |
|
|
{ |
|
|
$query = $this->findByMerchantQuery() ; |
|
|
$query = $this->findByMerchantQuery() ; |
|
|
$query = $this->joinRelations($query) ; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$query->leftJoin('e.productCategories', 'cat'); |
|
|
|
|
|
$query->addSelect('cat') ; |
|
|
|
|
|
|
|
|
|
|
|
$query->orderBy('e.position', 'ASC'); |
|
|
|
|
|
|
|
|
$query->andWhere('e.status = 1'); |
|
|
$query->andWhere('e.status = 1'); |
|
|
$query->andWhere('e.title LIKE :terms OR cat.title LIKE :terms'); |
|
|
$query->andWhere('e.title LIKE :terms OR cat.title LIKE :terms'); |