request->params([ ["resource_id",""], ["student_id",""], ["height",""], ["created_at",""], ["updated_at",""] ]); 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], ["coach_id",0], ["created_at",1747576653], ["updated_at",1747576653], ["seated_forward_bend",0.00], ["sit_ups",0.00], ["push_ups",0.00], ["flamingo_balance",0.00], ["thirty_sec_jump",0.00], ["standing_long_jump",0.00], ["agility_run",0.00], ["balance_beam",0.00], ["tennis_throw",0.00], ["ten_meter_shuttle_run",0.00] ]); $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], ["coach_id",0], ["created_at",1747576653], ["updated_at",1747576653], ["seated_forward_bend",0.00], ["sit_ups",0.00], ["push_ups",0.00], ["flamingo_balance",0.00], ["thirty_sec_jump",0.00], ["standing_long_jump",0.00], ["agility_run",0.00], ["balance_beam",0.00], ["tennis_throw",0.00], ["ten_meter_shuttle_run",0.00] ]); $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'); } }