学生端课程作业

This commit is contained in:
Dai 2024-08-07 10:51:00 +08:00
parent dfb9206b6b
commit cb82542ecd
3 changed files with 35 additions and 2 deletions

View File

@ -22,13 +22,13 @@ class StudentScheduleService
if (empty((array)$request->student) && empty((array)$request->parent)) { if (empty((array)$request->student) && empty((array)$request->parent)) {
throw new Exception('请登陆后再查看'); throw new Exception('请登陆后再查看');
} }
if(!empty((array)$request->student)){ if (!empty((array)$request->student)) {
$student = Student::where(['id' => $request->student->id])->findOrEmpty(); $student = Student::where(['id' => $request->student->id])->findOrEmpty();
if ($student->isEmpty()) { if ($student->isEmpty()) {
throw new Exception('未找到用户信息'); throw new Exception('未找到用户信息');
} }
} }
if(!empty((array)$request->parent)){ if (!empty((array)$request->parent)) {
$student = Student::where(['parent_id' => $request->parent->id])->findOrEmpty(); $student = Student::where(['parent_id' => $request->parent->id])->findOrEmpty();
if ($student->isEmpty()) { if ($student->isEmpty()) {
throw new Exception('未找到用户信息'); throw new Exception('未找到用户信息');

View File

@ -178,6 +178,33 @@ class SubjectHomeworkService
->with(['teacher', 'subject']) ->with(['teacher', 'subject'])
->findOrEmpty(); ->findOrEmpty();
if ($subject_homework->homework_file_url) {
$subject_homework->homework_file_url = json_decode($subject_homework->homework_file_url, true);
} else {
$subject_homework->homework_file_url = [];
}
if ($subject_homework->homework_version_file_url) {
$subject_homework->homework_version_file_url = json_decode($subject_homework->homework_version_file_url, true);
} else {
$subject_homework->homework_version_file_url = [];
}
if ($subject_homework->last_homework_feedback_url) {
$subject_homework->last_homework_feedback_url = json_decode($subject_homework->last_homework_feedback_url, true);
} else {
$subject_homework->last_homework_feedback_url = [];
}
if ($subject_homework->subject_report_url) {
$subject_homework->subject_report_url = json_decode($subject_homework->subject_report_url, true);
} else {
$subject_homework->subject_report_url = [];
}
if ($subject_homework->subject_file_url) {
$subject_homework->subject_file_url = json_decode($subject_homework->subject_file_url, true);
} else {
$subject_homework->subject_file_url = [];
}
return [ return [
'code' => ResponseCode::SUCCESS, 'code' => ResponseCode::SUCCESS,
'data' => $subject_homework, 'data' => $subject_homework,

View File

@ -210,6 +210,12 @@
}, { }, {
title: "教师", align: "center", title: "教师", align: "center",
field: "teacher_name", field: "teacher_name",
}, {
title: "课程", align: "center",
field: "subject_name",
}, {
title: "课程【英文】", align: "center",
field: "english_name",
}, { }, {
title: "教师排课id", align: "center", title: "教师排课id", align: "center",
field: "teacher_schedule_time_id", field: "teacher_schedule_time_id",