request->params([ ["member_id",""], ["name",""], ["gender",""], ["phone",""], ["email",""], ["position",""], ["status",""] ]); return success((new StaffService())->getPage($data)); } /** * 人员管理详情 * @param int $id * @return \think\Response */ public function info(int $id){ return success((new StaffService())->getInfo($id)); } /** * 添加人员管理 * @return \think\Response */ public function add(){ $data = $this->request->params([ ["member_id",0], ["name",""], ["header",""], ["gender",""], ["phone",""], ["email",""], ["position",""], ["status",""], ["role_id",0], ]); $this->validate($data, 'addon\zhjw\app\validate\staff\Staff.add'); $id = (new StaffService())->add($data); return success('ADD_SUCCESS', ['id' => $id]); } /** * 人员管理编辑 * @param $id 人员管理id * @return \think\Response */ public function edit(int $id){ $data = $this->request->params([ ["member_id",0], ["name",""], ["header",""], ["gender",""], ["phone",""], ["email",""], ["position",""], ["status",""], ["role_id",0], ]); $this->validate($data, 'addon\zhjw\app\validate\staff\Staff.edit'); (new StaffService())->edit($id, $data); return success('EDIT_SUCCESS'); } /** * 人员管理删除 * @param $id 人员管理id * @return \think\Response */ public function del(int $id){ (new StaffService())->del($id); return success('DELETE_SUCCESS'); } public function getMemberAll(){ return success(( new StaffService())->getMemberAll()); } }