4,251
社区成员
发帖
与我相关
我的任务
分享
public $belongsTo = array(
'Author' => array(
'className' => 'Author',
'foreignKey' => false,
'conditions'=>array("Book.author_cno"=>"Author.author_cno")
));
}
$options = array();
$options['joins'] = array(
array('table' => 'authors',
'alias' => 'Authors',
'type' => 'left',
'conditions' => array(
'Books.author_cno = Authors.author_cno'
)
));
$options['fields'] = array('Books.book_name','Authors.name');
$result = $this->Books->find('all',$options);