request->params([ ["resource_id",""], ["student_id",""] ]); return success((new PhysicalTestService())->getPage($data)); } /** * 体测详情 * @param int $id * @return \think\Response */ public function info(int $id){ return success((new PhysicalTestService())->getInfo($id)); } /** * 添加体测 * @return \think\Response */ public function add(){ $data = $this->request->params([ ["resource_id",0], ["student_id",0], ["height",0.00], ["weight",0.00], ["physical_test_report",[]], ]); $this->validate($data, 'app\validate\physical_test\PhysicalTest.add'); $id = (new PhysicalTestService())->add($data); return success('ADD_SUCCESS', ['id' => $id]); } /** * 体测编辑 * @param $id 体测id * @return \think\Response */ public function edit(int $id){ $data = $this->request->params([ ["resource_id",0], ["student_id",0], ["height",0.00], ["weight",0.00], ["physical_test_report",[]], ]); $this->validate($data, 'app\validate\physical_test\PhysicalTest.edit'); (new PhysicalTestService())->edit($id, $data); return success('EDIT_SUCCESS'); } /** * 体测删除 * @param $id 体测id * @return \think\Response */ public function del(int $id){ (new PhysicalTestService())->del($id); return success('DELETE_SUCCESS'); } public function getCustomerResourcesAll(){ return success(( new PhysicalTestService())->getCustomerResourcesAll()); } public function getStudentAll(){ return success(( new PhysicalTestService())->getStudentAll()); } public function getPersonnelAll(){ return success(( new PhysicalTestService())->getPersonnelAll()); } }