2011-02-16 58 views

回答

2

我刚刚注意到这实际上是属于关系。所以代码应该如下...

protected $_belongs_to = array(
    'user_from' => array('model' => 'user', 'foreign_key' => 'user_id_from'), 
    'user_to' => array('model' => 'user', 'foreign_key' => 'user_id_to') 
); 

user_from和user_to可以改变,但是你想要访问它们。

$message->user_from 

$message->user_to 
相关问题