고유 테이블에 대한 두 가지 요청이있는 작업이 있습니다. 요청 결과는 달라야합니다.하나의 작업에서 테이블에 대한 두 요청에 대한 문제
그러나 내 두 요청에 대한 결과는 동일하며 두 번째 요청에서 온 것입니다.
// Récupération du (ou des) locataire(s) actuel(s) du logement
$this->locataires = Doctrine_Query::create()
->from('logement l')
->leftJoin('l.Bail b')
->leftJoin('b.Locataire')
->where('l.id = ?', $request->getParameter('id'))
->andWhere('(b.datefin >= ?', date('Y-m-d', time()))
->orWhere("b.datefin = '0000-00-00')")
->execute();
// Récupération du (ou des) locataire(s) précédent(s) du logement
$this->locatairesprec = Doctrine_Query::create()
->from('logement l')
->leftJoin('l.Bail b')
->leftJoin('b.Locataire')
->where('l.id = ?', $request->getParameter('id'))
->andWhere('b.datefin < ?', date('Y-m-d', time()))
->andWhere("b.datefin != '0000-00-00'")
->orderBy('datedeb')
->execute();
이 PHP이다 사용하여 결과를 정렬? 그렇다면 태그하십시오. – leppie
ID로 선택하고 ID는 두 검색어에서 동일합니다. 왜 그것이 다른 결과를 가져올 것이라고 기대합니까? –
PHP 나 SQL이 아닙니다. 그것은 교리입니다. –