126 lines
3.6 KiB
PHP
126 lines
3.6 KiB
PHP
<?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\jxgl;
|
||
|
||
|
||
use app\admin\controller\BaseAdminController;
|
||
use app\oa\lists\jxgl\OaSelfExamineLists;
|
||
use app\oa\logic\jxgl\OaSelfExamineLogic;
|
||
use app\oa\validate\jxgl\OaSelfExamineValidate;
|
||
use app\common\model\jxgl\OaSelfExamineDetail;
|
||
|
||
|
||
/**
|
||
* 自评记录控制器
|
||
* Class OaSelfExamineController
|
||
* @package app\adminapi\controller\jxgl
|
||
*/
|
||
class OaSelfExamineController extends BaseAdminController
|
||
{
|
||
|
||
|
||
/**
|
||
* @notes 获取自评记录列表
|
||
* @return \think\response\Json
|
||
* @author likeadmin
|
||
* @date 2024/06/03 15:36
|
||
*/
|
||
public function lists()
|
||
{
|
||
return $this->dataLists(new OaSelfExamineLists());
|
||
}
|
||
|
||
|
||
/**
|
||
* @notes 添加自评记录
|
||
* @return \think\response\Json
|
||
* @author likeadmin
|
||
* @date 2024/06/03 15:36
|
||
*/
|
||
public function add()
|
||
{
|
||
$params = (new OaSelfExamineValidate())->post()->goCheck('add');
|
||
$result = OaSelfExamineLogic::add($params,$this->adminId);
|
||
if (true === $result) {
|
||
return $this->success('添加成功', [], 1, 1);
|
||
}
|
||
return $this->fail(OaSelfExamineLogic::getError());
|
||
}
|
||
|
||
|
||
/**
|
||
* @notes 编辑自评记录
|
||
* @return \think\response\Json
|
||
* @author likeadmin
|
||
* @date 2024/06/03 15:36
|
||
*/
|
||
public function edit()
|
||
{
|
||
$params = (new OaSelfExamineValidate())->post()->goCheck('edit');
|
||
$result = OaSelfExamineLogic::edit($params,$this->adminId);
|
||
if (true === $result) {
|
||
return $this->success('编辑成功', [], 1, 1);
|
||
}
|
||
return $this->fail(OaSelfExamineLogic::getError());
|
||
}
|
||
|
||
|
||
/**
|
||
* @notes 删除自评记录
|
||
* @return \think\response\Json
|
||
* @author likeadmin
|
||
* @date 2024/06/03 15:36
|
||
*/
|
||
public function delete()
|
||
{
|
||
$params = (new OaSelfExamineValidate())->post()->goCheck('delete');
|
||
$result = OaSelfExamineLogic::delete($params);
|
||
if (true === $result) {
|
||
return $this->success('删除成功', [], 1, 1);
|
||
}
|
||
return $this->fail(OaSelfExamineLogic::getError());
|
||
}
|
||
|
||
|
||
/**
|
||
* @notes 获取自评记录详情
|
||
* @return \think\response\Json
|
||
* @author likeadmin
|
||
* @date 2024/06/03 15:36
|
||
*/
|
||
public function detail()
|
||
{
|
||
$params = (new OaSelfExamineValidate())->goCheck('detail');
|
||
$result = OaSelfExamineLogic::detail($params);
|
||
return $this->data($result);
|
||
}
|
||
|
||
public function delete_detail()
|
||
{
|
||
$id = $this->request->post('id');
|
||
if(empty($id)){
|
||
return $this->fail('参数错误');
|
||
}
|
||
$data = OaSelfExamineDetail::where('id',$id)->findOrEmpty();
|
||
if($data->isEmpty()){
|
||
return $this->fail('考核项信息不存在');
|
||
}
|
||
$result = OaSelfExamineDetail::destroy($id);
|
||
return $result ? $this->success('删除成功' ,[], 1, 1) : $this->fail('删除失败');
|
||
}
|
||
|
||
|
||
} |