我想用 Doctrine 2 来做这个:
SELECT *,
(SELECT action FROM operations_history
WHERE timesheet.id = operations_history.timesheet_id
ORDER BY operations_history.created DESC
LIMIT 1) as status
FROM timesheet;
有什么帮助吗?如果可能的话,我想这样做createQueryBuilder();
。谢谢。