request->params([ ["class_id",""], ["courses_id",""], ["cycle",""] ]); return success((new TimetablesService())->getPage($data)); } /** * 课表管理详情 * @param int $id * @return \think\Response */ public function info(int $id){ return success((new TimetablesService())->getInfo($id)); } /** * 添加课表管理 * @return \think\Response */ public function add(){ $data = $this->request->params([ ["class_id",0], ["courses_id",0], ["schedule_date",""], ["cycle",""] ]); $this->validate($data, 'addon\zhjw\app\validate\timetables\Timetables.add'); $id = (new TimetablesService())->add($data); return success('ADD_SUCCESS', ['id' => $id]); } /** * 课表管理编辑 * @param $id 课表管理id * @return \think\Response */ public function edit(int $id){ $data = $this->request->params([ ["class_id",0], ["courses_id",0], ["schedule_date",""], ["cycle",""] ]); $this->validate($data, 'addon\zhjw\app\validate\timetables\Timetables.edit'); (new TimetablesService())->edit($id, $data); return success('EDIT_SUCCESS'); } /** * 课表管理删除 * @param $id 课表管理id * @return \think\Response */ public function del(int $id){ (new TimetablesService())->del($id); return success('DELETE_SUCCESS'); } public function getClassesAll(){ return success(( new TimetablesService())->getClassesAll()); } public function getCoursesAll(){ return success(( new TimetablesService())->getCoursesAll()); } }