如何在doctrine dql zend框架中使用Mysql Date函数

时间:2017-07-20 20:59:56

标签: mysql zend-framework doctrine-orm dql

我需要mysql日期函数,因为我只想用date而不是dateTime排序。

 $dql  = "SELECT r FROM Entities\Reservation r ";
 $dql .= "JOIN r.lot l ";
 $dql .= "LEFT JOIN r.car c";
 $dql .= " WHERE l.id = '" . $lot->id . "'" ;
 $dql .= " AND r.complete ='1' ";
 $dql .= " AND r.cancelled=0";
 $dql .= " ORDER BY r.start DESC, c.is_disabled_person DESC";        

 $query = $this->getEntityManager()->createQuery($dql);
 $query = $this->getResult();

0 个答案:

没有答案