|
|
|
|
|
|
|
|
$query = $this->findByMerchantQuery() ; |
|
|
$query = $this->findByMerchantQuery() ; |
|
|
$query = $this->joinRelations($query) ; |
|
|
$query = $this->joinRelations($query) ; |
|
|
$query->andWhere('e.status = 1') ; |
|
|
$query->andWhere('e.status = 1') ; |
|
|
|
|
|
$query->orderBy('RAND()'); |
|
|
return $query->getQuery()->getResult() ; |
|
|
return $query->getQuery()->getResult() ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$query->andWhere('e.status = 1'); |
|
|
$query->andWhere('e.status = 1'); |
|
|
$query->andWhere(':now <= e.propertyNoveltyExpirationDate') |
|
|
$query->andWhere(':now <= e.propertyNoveltyExpirationDate') |
|
|
->setParameter('now', new \DateTime()) ; |
|
|
->setParameter('now', new \DateTime()) ; |
|
|
$query->orderBy('e.createdAt', 'DESC'); |
|
|
|
|
|
|
|
|
$query->orderBy('RAND()'); |
|
|
|
|
|
|
|
|
return $query->getQuery()->getResult() ; |
|
|
return $query->getQuery()->getResult() ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return $query->getQuery()->getResult() ; |
|
|
return $query->getQuery()->getResult() ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getProductFamiliesBySection($section) |
|
|
|
|
|
|
|
|
public function getProductFamiliesBySection($section, $maxResults = false, $sortField = 'productCategories.position', $sortDirection = 'ASC') |
|
|
{ |
|
|
{ |
|
|
$query = $this->findByMerchantQuery() ; |
|
|
$query = $this->findByMerchantQuery() ; |
|
|
$query = $this->joinRelations($query) ; |
|
|
$query = $this->joinRelations($query) ; |
|
|
|
|
|
|
|
|
$query->andWhere(':section MEMBER OF e.sections') |
|
|
$query->andWhere(':section MEMBER OF e.sections') |
|
|
->setParameter('section', $section) ; |
|
|
->setParameter('section', $section) ; |
|
|
|
|
|
$query->leftJoin('e.productCategories', 'productCategories'); |
|
|
|
|
|
if($sortField){ |
|
|
|
|
|
$query->orderBy($sortField,$sortDirection); |
|
|
|
|
|
} |
|
|
|
|
|
if($maxResults) { |
|
|
|
|
|
$query->setMaxResults($maxResults) ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return $query->getQuery()->getResult() ; |
|
|
return $query->getQuery()->getResult() ; |
|
|
} |
|
|
} |