智慧教务系统 PHP-NiuCloud框架开发
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
3.0 KiB

<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址:https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace addon\zhjw\app\adminapi\controller\contracts;
use core\base\BaseAdminController;
use addon\zhjw\app\service\admin\contracts\ContractsService;
/**
* 合同管理控制器
* Class Contracts
* @package addon\zhjw\app\adminapi\controller\contracts
*/
class Contracts extends BaseAdminController
{
/**
* 获取合同管理列表
* @return \think\Response
*/
public function lists(){
$data = $this->request->params([
["student_id",""],
["title",""],
["start_date",["",""]],
["end_date",["",""]],
["status",""],
["create_time",["",""]]
]);
return success((new ContractsService())->getPage($data));
}
/**
* 合同管理详情
* @param int $id
* @return \think\Response
*/
public function info(int $id){
return success((new ContractsService())->getInfo($id));
}
/**
* 添加合同管理
* @return \think\Response
*/
public function add(){
$data = $this->request->params([
["student_id",0],
["title",""],
["content",""],
["file_data",""],
["start_date","2025-03-06 13:28:06"],
["end_date","2025-03-06 13:28:06"],
["status",""],
]);
$this->validate($data, 'addon\zhjw\app\validate\contracts\Contracts.add');
$id = (new ContractsService())->add($data);
return success('ADD_SUCCESS', ['id' => $id]);
}
/**
* 合同管理编辑
* @param $id 合同管理id
* @return \think\Response
*/
public function edit(int $id){
$data = $this->request->params([
["student_id",0],
["title",""],
["content",""],
["file_data",""],
["start_date","2025-03-06 13:28:06"],
["end_date","2025-03-06 13:28:06"],
["status",""],
]);
$this->validate($data, 'addon\zhjw\app\validate\contracts\Contracts.edit');
(new ContractsService())->edit($id, $data);
return success('EDIT_SUCCESS');
}
/**
* 合同管理删除
* @param $id 合同管理id
* @return \think\Response
*/
public function del(int $id){
(new ContractsService())->del($id);
return success('DELETE_SUCCESS');
}
public function getUsersAll(){
return success(( new ContractsService())->getUsersAll());
}
}