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.
96 lines
3.0 KiB
96 lines
3.0 KiB
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Niucloud-admin 企业快速开发的多应用管理平台
|
|
// +----------------------------------------------------------------------
|
|
// | 官方网址:https://www.niucloud.com
|
|
// +----------------------------------------------------------------------
|
|
// | niucloud团队 版权所有 开源版本可自由商用
|
|
// +----------------------------------------------------------------------
|
|
// | Author: Niucloud Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\adminapi\controller\person_course_schedule;
|
|
|
|
use core\base\BaseAdminController;
|
|
use app\service\admin\person_course_schedule\PersonCourseScheduleService;
|
|
|
|
|
|
/**
|
|
* 人员与课程安排关系控制器
|
|
* Class PersonCourseSchedule
|
|
* @package app\adminapi\controller\person_course_schedule
|
|
*/
|
|
class PersonCourseSchedule extends BaseAdminController
|
|
{
|
|
/**
|
|
* 获取人员与课程安排关系列表
|
|
* @return \think\Response
|
|
*/
|
|
public function lists(){
|
|
$data = $this->request->params([
|
|
["person_id",""],
|
|
["person_type",""],
|
|
["schedule_id",""],
|
|
["course_date",""],
|
|
["time_slot",""]
|
|
]);
|
|
return success((new PersonCourseScheduleService())->getPage($data));
|
|
}
|
|
|
|
/**
|
|
* 人员与课程安排关系详情
|
|
* @param int $id
|
|
* @return \think\Response
|
|
*/
|
|
public function info(int $id){
|
|
return success((new PersonCourseScheduleService())->getInfo($id));
|
|
}
|
|
|
|
/**
|
|
* 添加人员与课程安排关系
|
|
* @return \think\Response
|
|
*/
|
|
public function add(){
|
|
$data = $this->request->params([
|
|
["resources_id",0],
|
|
["schedule_id",0],
|
|
["schedule_id",0]
|
|
]);
|
|
$this->validate($data, 'app\validate\person_course_schedule\PersonCourseSchedule.add');
|
|
$id = (new PersonCourseScheduleService())->add($data);
|
|
return success('ADD_SUCCESS', ['id' => $id]);
|
|
}
|
|
|
|
/**
|
|
* 人员与课程安排关系编辑
|
|
* @param $id 人员与课程安排关系id
|
|
* @return \think\Response
|
|
*/
|
|
public function edit(int $id){
|
|
$data = $this->request->params([
|
|
["resources_id",0],
|
|
["schedule_id",0]
|
|
|
|
]);
|
|
$this->validate($data, 'app\validate\person_course_schedule\PersonCourseSchedule.edit');
|
|
(new PersonCourseScheduleService())->edit($id, $data);
|
|
return success('EDIT_SUCCESS');
|
|
}
|
|
|
|
/**
|
|
* 人员与课程安排关系删除
|
|
* @param $id 人员与课程安排关系id
|
|
* @return \think\Response
|
|
*/
|
|
public function del(int $id){
|
|
(new PersonCourseScheduleService())->del($id);
|
|
return success('DELETE_SUCCESS');
|
|
}
|
|
|
|
/**
|
|
* 获取试课人员
|
|
*/
|
|
public function getTryCoursePerson($schedule_id){
|
|
return success((new PersonCourseScheduleService())->getTryCoursePerson($schedule_id));
|
|
}
|
|
}
|
|
|