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.
119 lines
3.2 KiB
119 lines
3.2 KiB
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Niucloud-admin 企业快速开发的多应用管理平台
|
|
// +----------------------------------------------------------------------
|
|
// | 官方网址:https://www.niucloud.com
|
|
// +----------------------------------------------------------------------
|
|
// | niucloud团队 版权所有 开源版本可自由商用
|
|
// +----------------------------------------------------------------------
|
|
// | Author: Niucloud Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace addon\zhjw\app\adminapi\controller\schedules;
|
|
|
|
use core\base\BaseAdminController;
|
|
use addon\zhjw\app\service\admin\schedules\SchedulesService;
|
|
|
|
|
|
/**
|
|
* 排班管理控制器
|
|
* Class Schedules
|
|
* @package addon\zhjw\app\adminapi\controller\schedules
|
|
*/
|
|
class Schedules extends BaseAdminController
|
|
{
|
|
/**
|
|
* 获取排班管理列表
|
|
* @return \think\Response
|
|
*/
|
|
public function lists(){
|
|
$data = $this->request->params([
|
|
["staff_id",""],
|
|
["class_id",""],
|
|
["date_time",["",""]],
|
|
["task",""],
|
|
["create_time",["",""]]
|
|
]);
|
|
return success((new SchedulesService())->getPage($data));
|
|
}
|
|
|
|
/**
|
|
* 排班管理详情
|
|
* @param int $id
|
|
* @return \think\Response
|
|
*/
|
|
public function info(int $id){
|
|
return success((new SchedulesService())->getInfo($id));
|
|
}
|
|
|
|
public function get_info(){
|
|
$data = $this->request->params([
|
|
["courses_id",""],
|
|
["class_id",""],
|
|
["date_time",'']
|
|
]);
|
|
|
|
return success((new SchedulesService())->get_info($data));
|
|
}
|
|
|
|
|
|
/**
|
|
* 添加排班管理
|
|
* @return \think\Response
|
|
*/
|
|
public function add(){
|
|
$data = $this->request->params([
|
|
["staff_id",0],
|
|
["class_id",0],
|
|
["courses_id",0],
|
|
["date_time",""],
|
|
["time_slot",[]],
|
|
["task",""],
|
|
["schedules",[]]
|
|
|
|
]);
|
|
// $this->validate($data, 'addon\zhjw\app\validate\schedules\Schedules.add');
|
|
$id = (new SchedulesService())->add($data);
|
|
return success('ADD_SUCCESS', ['id' => $id]);
|
|
}
|
|
|
|
/**
|
|
* 排班管理编辑
|
|
* @param $id 排班管理id
|
|
* @return \think\Response
|
|
*/
|
|
public function edit(int $id){
|
|
$data = $this->request->params([
|
|
["staff_id",0],
|
|
["class_id",0],
|
|
["courses_id",0],
|
|
["date_time",""],
|
|
["time_slot",""],
|
|
["task",""],
|
|
|
|
]);
|
|
$this->validate($data, 'addon\zhjw\app\validate\schedules\Schedules.edit');
|
|
(new SchedulesService())->edit($id, $data);
|
|
return success('EDIT_SUCCESS');
|
|
}
|
|
|
|
/**
|
|
* 排班管理删除
|
|
* @param $id 排班管理id
|
|
* @return \think\Response
|
|
*/
|
|
public function del(int $id){
|
|
(new SchedulesService())->del($id);
|
|
return success('DELETE_SUCCESS');
|
|
}
|
|
|
|
|
|
public function getStaffAll(){
|
|
return success(( new SchedulesService())->getStaffAll());
|
|
}
|
|
|
|
public function getClassesAll(){
|
|
return success(( new SchedulesService())->getClassesAll());
|
|
}
|
|
|
|
}
|
|
|