I have two table student and student group. student_group_id is the foreign key in student table. Now listing of student table i want to show student group name(group_name) instead of student group id. Please tell me where i will change the code.
In student table:
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'm_student_group' => array(self::HAS_ONE, 'm_student_group', 'Group_Id'),
);
}
In student group table:
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'm_student' => array(self::HAS_ONE, 'm_student', 'Group_Id'),
);
}