lihaiMiddleOffice/app/oa/controller/works/rcbg/OaScheduleController.php

115 lines
3.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\oa\controller\works\rcbg;
use app\admin\controller\BaseAdminController;
use app\oa\lists\works\rcbg\OaScheduleLists;
use app\oa\logic\works\rcbg\OaScheduleLogic;
use app\oa\validate\works\rcbg\OaScheduleValidate;
/**
* 工作记录控制器
* Class OaScheduleController
* @package app\adminapi\controller\works\rcbg
*/
class OaScheduleController extends BaseAdminController
{
/**
* @notes 获取工作记录列表
* @return \think\response\Json
* @author likeadmin
* @date 2024/05/23 14:27
*/
public function lists()
{
return $this->dataLists(new OaScheduleLists());
}
/**
* @notes 添加工作记录
* @return \think\response\Json
* @author likeadmin
* @date 2024/05/23 14:27
*/
public function add()
{
$params = (new OaScheduleValidate())->post()->goCheck('add');
$result = OaScheduleLogic::add($params,$this->adminId);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
return $this->fail(OaScheduleLogic::getError());
}
/**
* @notes 编辑工作记录
* @return \think\response\Json
* @author likeadmin
* @date 2024/05/23 14:27
*/
public function edit()
{
$params = (new OaScheduleValidate())->post()->goCheck('edit');
$result = OaScheduleLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);
}
return $this->fail(OaScheduleLogic::getError());
}
/**
* @notes 删除工作记录
* @return \think\response\Json
* @author likeadmin
* @date 2024/05/23 14:27
*/
public function delete()
{
$params = (new OaScheduleValidate())->post()->goCheck('delete');
OaScheduleLogic::delete($params);
return $this->success('删除成功', [], 1, 1);
}
/**
* @notes 获取工作记录详情
* @return \think\response\Json
* @author likeadmin
* @date 2024/05/23 14:27
*/
public function detail()
{
$params = (new OaScheduleValidate())->goCheck('detail');
$result = OaScheduleLogic::detail($params);
return $this->data($result);
}
public function calendar(){
$params = (new OaScheduleValidate())->get()->goCheck('calendar');
$params['admin_id'] = $this->adminId;
$result = OaScheduleLogic::calendar($params);
return $this->data($result);
}
}