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.
106 lines
2.8 KiB
106 lines
2.8 KiB
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Niucloud-admin 企业快速开发的多应用管理平台
|
|
// +----------------------------------------------------------------------
|
|
// | 官方网址:https://www.niucloud.com
|
|
// +----------------------------------------------------------------------
|
|
// | niucloud团队 版权所有 开源版本可自由商用
|
|
// +----------------------------------------------------------------------
|
|
// | Author: Niucloud Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\adminapi\controller\contract;
|
|
|
|
use core\base\BaseAdminController;
|
|
use app\service\admin\contract\ContractService;
|
|
|
|
|
|
/**
|
|
* 合同控制器
|
|
* Class Contract
|
|
* @package app\adminapi\controller\contract
|
|
*/
|
|
class Contract extends BaseAdminController
|
|
{
|
|
/**
|
|
* 获取合同列表
|
|
* @return \think\Response
|
|
*/
|
|
public function lists(){
|
|
$data = $this->request->params([
|
|
["contract_status",""],
|
|
["contract_type",""],
|
|
["created_at",["",""]]
|
|
]);
|
|
return success((new ContractService())->getPage($data));
|
|
}
|
|
|
|
/**
|
|
* 合同详情
|
|
* @param int $id
|
|
* @return \think\Response
|
|
*/
|
|
public function info(int $id){
|
|
return success((new ContractService())->getInfo($id));
|
|
}
|
|
|
|
/**
|
|
* 添加合同
|
|
* @return \think\Response
|
|
*/
|
|
public function add(){
|
|
$data = $this->request->params([
|
|
["contract_name",""],
|
|
["contract_template",""],
|
|
["contract_status",""],
|
|
["contract_type",""],
|
|
["remarks",""],
|
|
|
|
]);
|
|
$this->validate($data, 'app\validate\contract\Contract.add');
|
|
$id = (new ContractService())->add($data);
|
|
return success('ADD_SUCCESS', ['id' => $id]);
|
|
}
|
|
|
|
/**
|
|
* 合同编辑
|
|
* @param $id 合同id
|
|
* @return \think\Response
|
|
*/
|
|
public function edit(int $id){
|
|
$data = $this->request->params([
|
|
["contract_name",""],
|
|
["contract_template",""],
|
|
["contract_status",""],
|
|
["contract_type",""],
|
|
["remarks",""],
|
|
|
|
]);
|
|
$this->validate($data, 'app\validate\contract\Contract.edit');
|
|
(new ContractService())->edit($id, $data);
|
|
return success('EDIT_SUCCESS');
|
|
}
|
|
|
|
/**
|
|
* 合同删除
|
|
* @param $id 合同id
|
|
* @return \think\Response
|
|
*/
|
|
public function del(int $id){
|
|
(new ContractService())->del($id);
|
|
return success('DELETE_SUCCESS');
|
|
}
|
|
|
|
|
|
public function ff_contract(){
|
|
$data = $this->request->params([
|
|
["id",""],
|
|
["uid",""]
|
|
]);
|
|
|
|
(new ContractService())->ff_contract($data);
|
|
|
|
return success();
|
|
}
|
|
|
|
}
|
|
|