学生排课信息添加课程作业数据
This commit is contained in:
parent
752dbe5804
commit
301f85e4d8
@ -22,7 +22,7 @@ use support\Model;
|
|||||||
// */
|
// */
|
||||||
class StudentSchedule extends BaseModel
|
class StudentSchedule extends BaseModel
|
||||||
{
|
{
|
||||||
|
|
||||||
public function teacher()
|
public function teacher()
|
||||||
{
|
{
|
||||||
return $this->hasOne(Teacher::class, 'id', 'teacher_id')->bind(['teacher_account'=>'account', 'teacher_name']);
|
return $this->hasOne(Teacher::class, 'id', 'teacher_id')->bind(['teacher_account'=>'account', 'teacher_name']);
|
||||||
@ -38,4 +38,9 @@ class StudentSchedule extends BaseModel
|
|||||||
return $this->hasOne(Student::class, 'id', 'student_id')->bind(['student_name', 'student_account'=>'account']);
|
return $this->hasOne(Student::class, 'id', 'student_id')->bind(['student_name', 'student_account'=>'account']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function subjectHomeworkArr()
|
||||||
|
{
|
||||||
|
return $this->hasOne(SubjectHomework::class, 'teacher_schedule_time_id', 'teacher_schedule_time_id');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,8 @@ class StudentScheduleService
|
|||||||
$schedule_time->where('date', $data['date']);
|
$schedule_time->where('date', $data['date']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$list = $schedule_time->with(['teacher', 'subject'])->select()->toArray();
|
//添加课程作业信息
|
||||||
|
$list = $schedule_time->with(['teacher', 'subject', 'subjectHomeworkArr'])->select()->toArray();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'code' => ResponseCode::SUCCESS,
|
'code' => ResponseCode::SUCCESS,
|
||||||
@ -60,4 +61,4 @@ class StudentScheduleService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user