安徽博创起重服务端程序
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.
 
 
 
 
 

109 lines
2.8 KiB

<?php
namespace app\admin\controller\job;
use app\admin\logic\job\JobSalaryLogic;
use app\common\basics\AdminBase;
use app\common\server\JsonServer;
class JobSalary extends AdminBase
{
/**
* @NOTES: 资源分类列表
* @author: 张无忌
*/
public function lists()
{
if ($this->request->isAjax()) {
$get = $this->request->get();
$lists = JobSalaryLogic::lists($get);
return JsonServer::success("获取成功", $lists);
}
return view('', [
'salarys' => JobSalaryLogic::getSalary(),
]);
}
/**
* @NOTES: 添加资源分类
* @author: 张无忌
*/
public function add()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$res = JobSalaryLogic::add($post);
if ($res === false) {
$error = JobSalaryLogic::getError() ?: '新增失败';
return JsonServer::error($error);
}
return JsonServer::success('新增成功');
}
return view('', [
'salarys' => JobSalaryLogic::getSalary(),
]);
}
/**
* @NOTES: 编辑分类
* @author: 张无忌
*/
public function edit()
{
if ($this->request->isAjax()) {
$post = $this->request->post();
$res = JobSalaryLogic::edit($post);
if ($res === false) {
$error = JobSalaryLogic::getError() ?: '编辑失败';
return JsonServer::error($error);
}
return JsonServer::success('编辑成功');
}
$id = $this->request->get('id');
return view('', [
'detail' => JobSalaryLogic::detail($id),
'salarys' => JobSalaryLogic::getSalary(),
]);
}
/**
* @NOTES: 删除分类
* @author: 张无忌
*/
public function del()
{
if ($this->request->isAjax()) {
$id = $this->request->post('id');
$res = JobSalaryLogic::del($id);
if ($res === false) {
$error = JobSalaryLogic::getError() ?: '删除失败';
return JsonServer::error($error);
}
return JsonServer::success('删除成功');
}
return JsonServer::error('异常');
}
/**
* @Notes: 隐藏分类
* @Author: 张无忌
*/
public function hide()
{
if ($this->request->isAjax()) {
$id = $this->request->post('id');
$res = JobSalaryLogic::hide($id);
if ($res === false) {
$error = JobSalaryLogic::getError() ?: '操作失败';
return JsonServer::error($error);
}
return JsonServer::success('操作成功');
}
return JsonServer::success('异常');
}
}