我有模型Trip
、Investment
和Person
。一次旅行有很多投资,每一项投资都属于一个人。当我说$this->Trip->find('all');
我得到:
Array (
[0] => Array (
[Trip] => Array (
[id] => 1
[date] => 2012-10-25 13:00:00
)
[Investments] => Array (
[0] => Array (
[id] => 1
[person_id] => 1
[investment_type_id] => 2
[trip_id] => 1
[investment] => 55
)
[1] => Array (
[id] => 2
[person_id] => 2
[investment_type_id] => 1
[trip_id] => 1
[investment] => 40
)
)
)
)
我希望每项投资都包含有关由person_id
(So their id
, theirname
等) 代表的人的信息。我已经在find('all')
查找中尝试了所有级别的递归,但没有运气。