request->params([ ["name",""], ["user_id",""], ["have_study_time",["",""]], ["end_study_time",["",""]], ["emergency_contact",""], ["level",""], ["status",""], ["create_time",["",""]] ]); return success((new StudentsService())->getPage($data)); } /** * 学员管理详情 * @param int $id * @return \think\Response */ public function info(int $id){ return success((new StudentsService())->getInfo($id)); } /** * 添加学员管理 * @return \think\Response */ public function add(){ $data = $this->request->params([ ["name",""], ["user_id",0], ["have_study_time",0.00], ["end_study_time",0.00], ["emergency_contact",""], ["level",""], ["status",""], ]); $this->validate($data, 'addon\zhjw\app\validate\students\Students.add'); $id = (new StudentsService())->add($data); return success('ADD_SUCCESS', ['id' => $id]); } /** * 学员管理编辑 * @param $id 学员管理id * @return \think\Response */ public function edit(int $id){ $data = $this->request->params([ ["name",""], ["user_id",0], ["have_study_time",0.00], ["end_study_time",0.00], ["emergency_contact",""], ["level",""], ["status",""], ]); $this->validate($data, 'addon\zhjw\app\validate\students\Students.edit'); (new StudentsService())->edit($id, $data); return success('EDIT_SUCCESS'); } /** * 学员管理删除 * @param $id 学员管理id * @return \think\Response */ public function del(int $id){ (new StudentsService())->del($id); return success('DELETE_SUCCESS'); } public function getStaffAll(){ return success(( new StudentsService())->getStaffAll()); } }