智慧教务系统 PHP-NiuCloud框架开发
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.
 
 
 
 
 
 

98 lines
2.8 KiB

<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址:https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\adminapi\controller\zhjw_students_survey;
use core\base\BaseAdminController;
use app\service\admin\zhjw_students_survey\ZhjwStudentsSurveyService;
/**
* 学员体测控制器
* Class ZhjwStudentsSurvey
* @package app\adminapi\controller\zhjw_students_survey
*/
class ZhjwStudentsSurvey extends BaseAdminController
{
/**
* 获取学员体测列表
* @return \think\Response
*/
public function lists(){
$data = $this->request->params([
["students_id",""],
["height",""],
["weight",""],
["update_time",""]
]);
return success((new ZhjwStudentsSurveyService())->getPage($data));
}
/**
* 学员体测详情
* @param int $id
* @return \think\Response
*/
public function info(int $id){
return success((new ZhjwStudentsSurveyService())->getInfo($id));
}
/**
* 添加学员体测
* @return \think\Response
*/
public function add(){
$data = $this->request->params([
["students_id",0],
["height",0.00],
["weight",0.00],
["content",""],
]);
$this->validate($data, 'app\validate\zhjw_students_survey\ZhjwStudentsSurvey.add');
$id = (new ZhjwStudentsSurveyService())->add($data);
return success('ADD_SUCCESS', ['id' => $id]);
}
/**
* 学员体测编辑
* @param $id 学员体测id
* @return \think\Response
*/
public function edit(int $id){
$data = $this->request->params([
["students_id",0],
["height",0.00],
["weight",0.00],
["content",""],
]);
$this->validate($data, 'app\validate\zhjw_students_survey\ZhjwStudentsSurvey.edit');
(new ZhjwStudentsSurveyService())->edit($id, $data);
return success('EDIT_SUCCESS');
}
/**
* 学员体测删除
* @param $id 学员体测id
* @return \think\Response
*/
public function del(int $id){
(new ZhjwStudentsSurveyService())->del($id);
return success('DELETE_SUCCESS');
}
public function getStudentsAll(){
return success(( new ZhjwStudentsSurveyService())->getStudentsAll());
}
}