Don't exclude non-searchable products in hotel list

This commit is contained in:
Björn Fromme
2018-09-27 12:05:16 +02:00
parent 6ecdc3f890
commit 2b3aa8764f
@@ -84,7 +84,7 @@ class HotelRepository extends AbstractRepository
*/ */
public function getListByProduct($productUid) public function getListByProduct($productUid)
{ {
$qb = $this->getQueryBuilder(); $qb = $this->getQueryBuilder(false);
$qb $qb
->andWhere('date.product = :productUid') ->andWhere('date.product = :productUid')
->setParameter('productUid', $productUid) ->setParameter('productUid', $productUid)
@@ -215,12 +215,14 @@ class HotelRepository extends AbstractRepository
} }
/** /**
* @param bool $excludeNonSearchable
* @return \Doctrine\DBAL\Query\QueryBuilder * @return \Doctrine\DBAL\Query\QueryBuilder
*/ */
protected function getQueryBuilder() protected function getQueryBuilder($excludeNonSearchable = true)
{ {
$qb = DbUtility::getDbConnection()->createQueryBuilder(); $qb = DbUtility::getDbConnection()->createQueryBuilder();
return $qb
$qb
->select( ->select(
'date.hotel hotelUid', 'date.hotel_name hotelName', 'date.hotel_teaser hotelTeaser', 'date.hotel hotelUid', 'date.hotel_name hotelName', 'date.hotel_teaser hotelTeaser',
'date.hotel_category hotelCategory', 'date.hotel_detail_page hotelDetailPage', 'date.hotel_category hotelCategory', 'date.hotel_detail_page hotelDetailPage',
@@ -233,12 +235,17 @@ class HotelRepository extends AbstractRepository
) )
->from('tx_epproducts_domain_model_date', 'date') ->from('tx_epproducts_domain_model_date', 'date')
->leftJoin('date', 'tx_epproducts_product_region_mm', 'mm', 'mm.uid_local = date.product') ->leftJoin('date', 'tx_epproducts_product_region_mm', 'mm', 'mm.uid_local = date.product')
//->where('date.product_searchable = 1')
->addGroupBy('date.hotel') ->addGroupBy('date.hotel')
->addGroupBy('date.date_start') ->addGroupBy('date.date_start')
->addGroupBy('date.nights') ->addGroupBy('date.nights')
->orderBy('FIELD(date.hotel_type, ' . Hotel::TYPE_SPORTS_CLUB . ')', 'DESC') ->orderBy('FIELD(date.hotel_type, ' . Hotel::TYPE_SPORTS_CLUB . ')', 'DESC')
; ;
if ($excludeNonSearchable) {
$qb->where('date.product_searchable = 1');
}
return $qb;
} }
/** /**