表:graduate_applicants
CREATE TABLE IF NOT EXISTS `graduate_applicants` (
`grat_id` int(10) NOT NULL auto_increment,
`studentnum` int(9) NOT NULL,
`QuarterID` int(10) NOT NULL,
PRIMARY KEY (`grat_id`)
)
表:学生学生
CREATE TABLE IF NOT EXISTS `stu_students` (
`id` int(11) NOT NULL auto_increment,
`studentid` int(9) default NULL,
`firstname` varchar(50) default NULL,
`lastname` varchar(50) default NULL,
`email` varchar(100) default NULL,
PRIMARY KEY (`id`),
KEY `studentid` (`studentid`),
)
型号:</p>
class GraduateApplicant extends AppModel{
var $name = 'GraduateApplicant';
var $tablePrefix = '';
var $belongsTo = array('Student' => array('className' => 'Student','foreignKey' => false,''conditions' => array('Student.studentid=GraduateApplicant.studentnum'),'fields' => '','order' => ''),);
}
控制器:
$list = $this->paginate('GraduateApplicant');
我不明白为什么 $list 是空的?