* Suchformular auf Startseite funktioniert nun
* Neueste Design-Änderungen aufgenommen * Sortierung auf Reiseübersichtsseiten * Fehler bei Suche behoben git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3285 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
parent
99c6715712
commit
23b2c7a7e8
12 changed files with 217 additions and 119 deletions
|
|
@ -40,7 +40,10 @@ class TravelPeriodRepository extends \Doctrine\ORM\EntityRepository
|
|||
$startDate = $now;
|
||||
}
|
||||
$startDateStr = $startDate->format('Y-m-d');
|
||||
$endDateStr = $endDate->format('Y-m-d');
|
||||
if ($endDate)
|
||||
{
|
||||
$endDateStr = $endDate->format('Y-m-d');
|
||||
}
|
||||
|
||||
$qb = $this->getEntityManager()->createQueryBuilder()
|
||||
->from('AppBundle:TravelProgram', 'tp', 'tp.id')
|
||||
|
|
@ -64,7 +67,7 @@ class TravelPeriodRepository extends \Doctrine\ORM\EntityRepository
|
|||
{
|
||||
$priceTypeKey = 'price_'. $priceType->getId();
|
||||
$qb->leftJoin('p.prices', $priceTypeKey, Expr\Join::WITH,
|
||||
$priceTypeKey .'.priceType = '. $priceType->getId(), null, $priceTypeKey .'.priceType');
|
||||
$priceTypeKey .'.priceType = '. $priceType->getId(), $priceTypeKey .'.priceTypeId');
|
||||
$qb->addSelect($priceTypeKey);
|
||||
}
|
||||
$qb->leftJoin('p.discounts', 'discount');
|
||||
|
|
@ -77,11 +80,14 @@ class TravelPeriodRepository extends \Doctrine\ORM\EntityRepository
|
|||
// Destinations
|
||||
if (!empty($destinationIds) && is_array($destinationIds))
|
||||
{
|
||||
$qb->innerJoin('AppBundle:TravelProgramCountry', 'tpc', Expr\Join::WITH,
|
||||
'tpc.program = tp AND IDENTITY(tpc.country) IN ('. implode(', ', $destinationIds) .')');
|
||||
//$qb->innerJoin('AppBundle:TravelProgramCountry', 'tpc', Expr\Join::WITH,
|
||||
// 'tpc.program = tp AND IDENTITY(tpc.country) IN ('. implode(', ', $destinationIds) .')');
|
||||
$qb->innerJoin('tp.countries', 'tc', Expr\Join::WITH,
|
||||
'tc.id IN ('. implode(', ', $destinationIds) .')');
|
||||
if ($combi)
|
||||
{
|
||||
$qb->having('COUNT(DISTINCT tpc.country) = '. count($destinationIds));
|
||||
//$qb->having('COUNT(DISTINCT tpc.country) = '. count($destinationIds));
|
||||
$qb->having('COUNT(DISTINCT tc) = '. count($destinationIds));
|
||||
}
|
||||
}
|
||||
$qb->groupBy('p.id, p_dep.id, d.id');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue