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

112 lines
3.2 KiB

<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址:https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\adminapi\controller\course_schedule;
use core\base\BaseAdminController;
use app\service\admin\course_schedule\CourseScheduleService;
/**
* 课程安排控制器
* Class CourseSchedule
* @package app\adminapi\controller\course_schedule
*/
class CourseSchedule extends BaseAdminController
{
/**
* 获取课程安排列表
* @return \think\Response
*/
public function lists(){
$data = $this->request->params([
["campus_id",""],
["venue_id",""],
["course_date",""],
["time_slot",""],
["course_id",""],
["coach_id",""],
["participants",""],
["student_ids",""],
["available_capacity",""],
["status",""]
]);
return success((new CourseScheduleService())->getPage($data));
}
/**
* 课程安排详情
* @param int $id
* @return \think\Response
*/
public function info(int $id){
return success((new CourseScheduleService())->getInfo($id));
}
/**
* 添加课程安排
* @return \think\Response
*/
public function add(){
$data = $this->request->params([
["campus_id",0],
["venue_id",0],
["course_date","2025-05-16 17:28:06"],
["time_slot",""],
["course_id",0],
["coach_id",0],
["participants",""],
["student_ids",""],
["available_capacity",0],
["status",""],
]);
$this->validate($data, 'app\validate\course_schedule\CourseSchedule.add');
$id = (new CourseScheduleService())->add($data);
return success('ADD_SUCCESS', ['id' => $id]);
}
/**
* 课程安排编辑
* @param $id 课程安排id
* @return \think\Response
*/
public function edit(int $id){
$data = $this->request->params([
["campus_id",0],
["venue_id",0],
["course_date","2025-05-16 17:28:06"],
["time_slot",""],
["course_id",0],
["coach_id",0],
["participants",""],
["student_ids",""],
["available_capacity",0],
["status",""],
]);
$this->validate($data, 'app\validate\course_schedule\CourseSchedule.edit');
(new CourseScheduleService())->edit($id, $data);
return success('EDIT_SUCCESS');
}
/**
* 课程安排删除
* @param $id 课程安排id
* @return \think\Response
*/
public function del(int $id){
(new CourseScheduleService())->del($id);
return success('DELETE_SUCCESS');
}
}