关系:
'attendances' => array(self::HAS_MANY, 'Attendance', 'atd_atbs_Id')
控制器:
$report=AtbStud::model()->with('attendances')->findAll('atbs_atb_Id='.$id);
foreach ($report->attendances as $value) {
echo Yii::trace(CVarDumper::dumpAsString($value->atd_Date),'vardump');;
}
错误:
"$report->attendances" Trying to get property of non-object.
如果我们使用 has_many 关系,我们如何访问值。