request->params([ ["staff_id",""], ["class_id",""], ["date_time",["",""]], ["task",""], ["create_time",["",""]] ]); return success((new SchedulesService())->getPage($data)); } /** * 排班管理详情 * @param int $id * @return \think\Response */ public function info(int $id){ return success((new SchedulesService())->getInfo($id)); } public function get_info(){ $data = $this->request->params([ ["courses_id",""], ["class_id",""], ["date_time",''] ]); return success((new SchedulesService())->get_info($data)); } /** * 添加排班管理 * @return \think\Response */ public function add(){ $data = $this->request->params([ ["staff_id",0], ["class_id",0], ["courses_id",0], ["date_time",""], ["time_slot",[]], ["task",""], ["schedules",[]] ]); // $this->validate($data, 'addon\zhjw\app\validate\schedules\Schedules.add'); $id = (new SchedulesService())->add($data); return success('ADD_SUCCESS', ['id' => $id]); } /** * 排班管理编辑 * @param $id 排班管理id * @return \think\Response */ public function edit(int $id){ $data = $this->request->params([ ["staff_id",0], ["class_id",0], ["courses_id",0], ["date_time",""], ["time_slot",""], ["task",""], ]); $this->validate($data, 'addon\zhjw\app\validate\schedules\Schedules.edit'); (new SchedulesService())->edit($id, $data); return success('EDIT_SUCCESS'); } /** * 排班管理删除 * @param $id 排班管理id * @return \think\Response */ public function del(int $id){ (new SchedulesService())->del($id); return success('DELETE_SUCCESS'); } public function getStaffAll(){ return success(( new SchedulesService())->getStaffAll()); } public function getClassesAll(){ return success(( new SchedulesService())->getClassesAll()); } }