request->params([ ["person_id",""], ["person_type",""], ["schedule_id",""], ["course_date",""], ["time_slot",""] ]); return success((new PersonCourseScheduleService())->getPage($data)); } /** * 人员与课程安排关系详情 * @param int $id * @return \think\Response */ public function info(int $id){ return success((new PersonCourseScheduleService())->getInfo($id)); } /** * 添加人员与课程安排关系 * @return \think\Response */ public function add(){ $data = $this->request->params([ ["resources_id",0], ["schedule_id",0], ["schedule_id",0] ]); $this->validate($data, 'app\validate\person_course_schedule\PersonCourseSchedule.add'); $id = (new PersonCourseScheduleService())->add($data); return success('ADD_SUCCESS', ['id' => $id]); } /** * 人员与课程安排关系编辑 * @param $id 人员与课程安排关系id * @return \think\Response */ public function edit(int $id){ $data = $this->request->params([ ["resources_id",0], ["schedule_id",0] ]); $this->validate($data, 'app\validate\person_course_schedule\PersonCourseSchedule.edit'); (new PersonCourseScheduleService())->edit($id, $data); return success('EDIT_SUCCESS'); } /** * 人员与课程安排关系删除 * @param $id 人员与课程安排关系id * @return \think\Response */ public function del(int $id){ (new PersonCourseScheduleService())->del($id); return success('DELETE_SUCCESS'); } /** * 获取试课人员 */ public function getTryCoursePerson($schedule_id){ return success((new PersonCourseScheduleService())->getTryCoursePerson($schedule_id)); } }