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.
110 lines
2.8 KiB
110 lines
2.8 KiB
<?php
|
|
|
|
|
|
namespace app\admin\controller\financeService;
|
|
|
|
|
|
use app\admin\logic\financeService\ContractCateLogic;
|
|
use app\admin\logic\financeService\ContractLogic;
|
|
use app\admin\logic\job\JobCateLogic;
|
|
use app\admin\logic\job\JobIndustryLogic;
|
|
use app\admin\logic\job\JobLogic;
|
|
use app\admin\logic\job\JobSalaryLogic;
|
|
use app\common\basics\AdminBase;
|
|
use app\common\server\AreaServer;
|
|
use app\common\server\JsonServer;
|
|
|
|
class Contract extends AdminBase
|
|
{
|
|
/**
|
|
* @NOTES: 帮助分类列表
|
|
* @author: 张无忌
|
|
*/
|
|
public function lists()
|
|
{
|
|
if ($this->request->isAjax()) {
|
|
$get = $this->request->get();
|
|
$lists = ContractLogic::lists($get);
|
|
return JsonServer::success("获取成功", $lists);
|
|
}
|
|
|
|
return view('', [
|
|
'cates' => ContractCateLogic::getCate()
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* @NOTES: 添加帮助类
|
|
* @author: 张无忌
|
|
*/
|
|
public function add()
|
|
{
|
|
if ($this->request->isAjax()) {
|
|
$post = $this->request->post();
|
|
$res = ContractLogic::add($post);
|
|
if ($res === false) {
|
|
$error = ContractLogic::getError() ?: '新增失败';
|
|
return JsonServer::error($error);
|
|
}
|
|
return JsonServer::success('新增成功');
|
|
}
|
|
|
|
|
|
return view('', [
|
|
'cates' => ContractCateLogic::getCate()
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* @NOTES: 编辑帮助分类
|
|
* @author: 张无忌
|
|
*/
|
|
public function edit()
|
|
{
|
|
if ($this->request->isAjax()) {
|
|
$post = $this->request->post();
|
|
$res = ContractLogic::edit($post);
|
|
if ($res === false) {
|
|
$error = ContractLogic::getError() ?: '编辑失败';
|
|
return JsonServer::error($error);
|
|
}
|
|
return JsonServer::success('编辑成功');
|
|
}
|
|
|
|
|
|
$id = $this->request->get('id');
|
|
$detail = ContractLogic::detail($id);
|
|
$category2 = [];
|
|
if($detail['cate_id']>0){
|
|
$category2 = ContractCateLogic::getCate($detail['cate_id']);
|
|
}
|
|
|
|
return view('', [
|
|
'detail' => $detail,
|
|
'cates' => ContractCateLogic::getCate(),
|
|
'cate2' => $category2,
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* @NOTES: 删除帮助分类
|
|
* @author: 张无忌
|
|
*/
|
|
public function del()
|
|
{
|
|
if ($this->request->isAjax()) {
|
|
$id = $this->request->post('id');
|
|
$res = ContractLogic::del($id);
|
|
if ($res === false) {
|
|
$error = ContractLogic::getError() ?: '删除失败';
|
|
return JsonServer::error($error);
|
|
}
|
|
return JsonServer::success('删除成功');
|
|
}
|
|
|
|
return JsonServer::error('异常');
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|