智慧教务系统
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.
 
 
 
 
 
 

97 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([
["person_id",0],
["person_type",""],
["schedule_id",0],
["course_date","2025-05-16 17:47:53"],
["time_slot",""],
]);
$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([
["person_id",0],
["person_type",""],
["schedule_id",0],
["course_date","2025-05-16 17:47:53"],
["time_slot",""],
]);
$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');
}
}