教师排课添加日期获取
This commit is contained in:
parent
48c1e511ef
commit
6c7f894636
@ -92,8 +92,15 @@ class TeacherScheduleTimeService
|
|||||||
}
|
}
|
||||||
$data = $request->get();
|
$data = $request->get();
|
||||||
|
|
||||||
$schedule = TeacherScheduleTime::where(['teacher_id'=>$teacher->id, 'month'=>$data['month']])
|
$schedule = TeacherScheduleTime::order('id desc')->where(['teacher_id' => $teacher->id]);
|
||||||
->field('id,teacher_id,date,time,hour,month,subject_id,is_publish')
|
if (isset($data['month']) && !empty($data['month'])) {
|
||||||
|
$schedule->where('month', $data['month']);
|
||||||
|
}
|
||||||
|
if (isset($data['date']) && !empty($data['date'])) {
|
||||||
|
$schedule->where('date', $data['date']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$list = $schedule->field('id,teacher_id,date,time,hour,month,subject_id,is_publish')
|
||||||
->with(['subject'])
|
->with(['subject'])
|
||||||
->select();
|
->select();
|
||||||
|
|
||||||
@ -106,7 +113,7 @@ class TeacherScheduleTimeService
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'code' => ResponseCode::SUCCESS,
|
'code' => ResponseCode::SUCCESS,
|
||||||
'data'=>$schedule,
|
'data' => $list,
|
||||||
'msg' => 'success',
|
'msg' => 'success',
|
||||||
];
|
];
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user