7

如何在 Doctrine 1.2 ORM 的 where 子句中设置条件以在 DQL 示例中指定大于日期

Doctrine_Query::create()
    ->from('user u')
    ->where(?)
    ->execute();

谢谢

4

1 回答 1

8

例如:

$one_year_ago = date('Y-m-d H:i:s', strtotime('1 year ago'));

->where('u.created_at > ?', $one_year_ago)
于 2011-07-15T09:14:26.403 回答