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