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.
119 lines
3.1 KiB
119 lines
3.1 KiB
<?php
|
|
|
|
|
|
namespace app\admin\controller\job;
|
|
|
|
|
|
use app\admin\logic\content\ArticleCategoryLogic;
|
|
use app\admin\logic\content\ResourceCategoryLogic;
|
|
use app\admin\logic\content\ResourceLogic;
|
|
use app\admin\logic\job\JobCateLogic;
|
|
use app\admin\logic\job\JobIndustryLogic;
|
|
use app\admin\logic\job\JobSalaryLogic;
|
|
use app\admin\validate\content\ArticleCategoryValidate;
|
|
use app\common\basics\AdminBase;
|
|
use app\common\model\job\JobSalary;
|
|
use app\common\server\JsonServer;
|
|
|
|
class JobCate extends AdminBase
|
|
{
|
|
/**
|
|
* @NOTES: 资源分类列表
|
|
* @author: 张无忌
|
|
*/
|
|
public function lists()
|
|
{
|
|
if ($this->request->isAjax()) {
|
|
$get = $this->request->get();
|
|
$lists = JobCateLogic::lists($get);
|
|
return JsonServer::success("获取成功", $lists);
|
|
}
|
|
|
|
return view('', [
|
|
'cates' => JobCateLogic::getCate(),
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* @NOTES: 添加资源分类
|
|
* @author: 张无忌
|
|
*/
|
|
public function add()
|
|
{
|
|
if ($this->request->isAjax()) {
|
|
$post = $this->request->post();
|
|
$res = JobCateLogic::add($post);
|
|
if ($res === false) {
|
|
$error = JobCateLogic::getError() ?: '新增失败';
|
|
return JsonServer::error($error);
|
|
}
|
|
return JsonServer::success('新增成功');
|
|
}
|
|
|
|
|
|
return view('', [
|
|
'cates' => JobCateLogic::getCate(),
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* @NOTES: 编辑分类
|
|
* @author: 张无忌
|
|
*/
|
|
public function edit()
|
|
{
|
|
if ($this->request->isAjax()) {
|
|
$post = $this->request->post();
|
|
$res = JobCateLogic::edit($post);
|
|
if ($res === false) {
|
|
$error = JobCateLogic::getError() ?: '编辑失败';
|
|
return JsonServer::error($error);
|
|
}
|
|
return JsonServer::success('编辑成功');
|
|
}
|
|
|
|
$id = $this->request->get('id');
|
|
return view('', [
|
|
'detail' => JobCateLogic::detail($id),
|
|
'cates' => JobCateLogic::getCate(),
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* @NOTES: 删除分类
|
|
* @author: 张无忌
|
|
*/
|
|
public function del()
|
|
{
|
|
if ($this->request->isAjax()) {
|
|
$id = $this->request->post('id');
|
|
$res = JobCateLogic::del($id);
|
|
if ($res === false) {
|
|
$error = JobCateLogic::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 = JobCateLogic::hide($id);
|
|
if ($res === false) {
|
|
$error = JobCateLogic::getError() ?: '操作失败';
|
|
return JsonServer::error($error);
|
|
}
|
|
return JsonServer::success('操作成功');
|
|
}
|
|
|
|
return JsonServer::success('异常');
|
|
}
|
|
}
|
|
|