fix 学生上传课程作业

This commit is contained in:
Dai 2024-10-09 09:51:43 +08:00
parent 34e07d8bd6
commit be59c0a49a

View File

@ -40,7 +40,12 @@ class StudentHomeworkService
$data = $request->post(); $data = $request->post();
$subject_homework = SubjectHomework::where(['id' => $data['subject_homework_id'], 'is_publish' => 1])->findOrEmpty(); $student_schedule = StudentSchedule::where(['id' => $data['subject_homework_id']])->findOrEmpty();
if($student_schedule->isEmpty()){
throw new Exception('未找到学生排课信息');
}
$subject_homework = SubjectHomework::where(['teacher_schedule_time_id' => $student_schedule->teacher_schedule_time_id, 'is_publish' => 1])->findOrEmpty();
if ($subject_homework->isEmpty()) { if ($subject_homework->isEmpty()) {
throw new Exception('老师还未布置课程作业'); throw new Exception('老师还未布置课程作业');
} }