diff --git a/app/common/service/TeacherScheduleTimeService.php b/app/common/service/TeacherScheduleTimeService.php index 79a6f2d..95b5939 100644 --- a/app/common/service/TeacherScheduleTimeService.php +++ b/app/common/service/TeacherScheduleTimeService.php @@ -92,7 +92,7 @@ class TeacherScheduleTimeService } $data = $request->get(); - $schedule = TeacherScheduleTime::order('id desc')->where(['teacher_id' => $teacher->id]); + $schedule = TeacherScheduleTime::order('id desc')->where(['teacher_id' => $teacher->id, 'is_publish' => 1]); if (isset($data['month']) && !empty($data['month'])) { $schedule->where('month', $data['month']); } @@ -107,9 +107,9 @@ class TeacherScheduleTimeService foreach ($list as $key => &$item) { if ($item['studentSchedule']) { foreach ($item['studentSchedule'] as $index => $value) { - if(!$value['is_publish']){ + if (!$value['is_publish']) { unset($item['studentSchedule'][$index]); - }else{ + } else { unset($item['studentSchedule'][$index]['deleted_at']); unset($item['studentSchedule'][$index]['updated_at']); unset($item['studentSchedule'][$index]['created_at']); @@ -120,16 +120,16 @@ class TeacherScheduleTimeService } } } - if($item['studentHomework']){ + if ($item['studentHomework']) { $item['has_homework'] = 0; foreach ($item['studentHomework'] as $index => $value) { - if($value['is_publish']){ + if ($value['is_publish']) { $item['has_homework'] = 1; - }else{ + } else { unset($item['studentHomework'][$index]); } } - }else{ + } else { $item['has_homework'] = 0; } }