0

因此,我有关系查询的关系,我只想为表 CancellationRequest c 选择最近创建的记录。

任何人都知道这是否/应该是可能的以及如何?

Doctrine_Query::create()
    ->from('UserNotificationTo unt')
    ->leftJoin('unt.Notification un')
    ->leftJoin('un.QuoteOrder qo')
    ->leftJoin('qo.CancellationRequest c')
    ->where('un.sent_external = 0')
    ->andWhere('c.updated_at *IS THE MOST RECENTLY CREATED ONE*')
    ->execute();
4

1 回答 1

1

你必须做 ORDER BY c.updated_at

然后你可以这样做:

$userNotifcation->getQuoteOrder()->getCancellationRequest()->first()

获取最新的

于 2013-08-05T13:39:27.467 回答