1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| public function ajaxLiveOffersFinder($app, $country, $platform)
{
$this->isWhere = true;
$qb = $this->_em->createQueryBuilder();
$qb->select('off.id as id_offer, plt.id as id_platform, mangapp.id as id_mangooapp, omp.nbClick, omp.nbDownload, off.appName, off.appIcon, off.link, off.maxPayout, off.countriesAllowed')
->from('MangooGamesGeneralBundle:OfferMangooappPlatform', 'omp')
->join('omp.offer', 'off')
->join('omp.mangooapp', 'mangapp')
->join('omp.platform', 'plt')
->groupBy('off.id');
$this->addWhere($qb, 'omp', 'isActive', true);
$this->addWhere($qb, 'off', 'isActive', true);
if ($app != 'all' && $app != "")
$this->addWhere($qb, 'omp', 'mangooapp', $app);
else {
// C'est ici que doit être ajoutée la requête imbriquée $qb->having('');
}
if ($country)
$this->addWhere($qb, 'off', 'countriesAllowed', $country, true);
if ($platform)
$this->addWhere($qb, 'omp', 'platform', $platform);
return $qb->getQuery()->getResult();
} |