智慧教务系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

124 lines
3.6 KiB

<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址:https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\adminapi\controller\physical_test;
use core\base\BaseAdminController;
use app\service\admin\physical_test\PhysicalTestService;
/**
* 体测控制器
* Class PhysicalTest
* @package app\adminapi\controller\physical_test
*/
class PhysicalTest extends BaseAdminController
{
/**
* 获取体测列表
* @return \think\Response
*/
public function lists(){
$data = $this->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],
["coach_id",0],
["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],
["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');
}
public function getCustomerResourcesAll(){
return success(( new PhysicalTestService())->getCustomerResourcesAll());
}
public function getStudentAll(){
return success(( new PhysicalTestService())->getStudentAll());
}
public function getPersonnelAll(){
return success(( new PhysicalTestService())->getPersonnelAll());
}
}