1 Star 0 Fork 0

sky/company

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
api.php 1.93 KB
一键复制 编辑 原始数据 按行查看 历史
sky 提交于 2024-01-04 15:13 . 提交项目
<?php
include_once('config/config.php');
if($_POST){
$action = $_POST['action'] ?? '';
$adminid = $_POST['adminid'] ?? '';
}
if(!$adminid){
fail('请先登录!');
}
switch($action)
{
case 'dep':
$sql_dep = "select * from `pre_department` order by `id` desc";
$dep_data = all($sql_dep);
if($dep_data)
{
success('请求部门数据成功!',$dep_data);
}else{
fail('请求部门数据失败!');
}
break;
case 'job':
$depid = $_POST['depid'] ?? 0;
$sql_job = "select * from `pre_job` where `depid` = '$depid'";
$job_data = all($sql_job);
if($job_data)
{
success('请求职位数据成功!',$job_data);
}else{
fail('请求职位数据失败!');
}
break;
case 'get_job_by_id':
$id = $_POST['id'] ?? 0;
$sql_job1 = "select * from `pre_job` where `id` = '$id'";
$job_data1 = find($sql_job1);
if($job_data1)
{
success('请求职位数据成功!',$job_data1);
}else{
fail('请求职位数据失败!');
}
break;
case 'get_person_by_id':
$id = $_POST['id'] ?? 0;
$sql_person = "select `p`.*,`r`.province as r1,`r`.city as r2, `r`.district as r3 from `pre_person` as `p` left join `pre_region` as `r` on `p`.id = '$id' and `r`.parentpath rlike `p`.district";
$person_data = find($sql_person);
if($person_data)
{
success('请求职位数据成功!',$person_data);
}else{
fail('请求职位数据失败!');
}
break;
case 'file':
$filename = ltrim($_POST['filename'], '/') ?? '';
$res = is_file($filename);
if($res){
success('指定文件存在',$filename);
}else{
fail('指定文件不存在',$filename);
}
}
?>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/JIE_XIAOQIU/company.git
git@gitee.com:JIE_XIAOQIU/company.git
JIE_XIAOQIU
company
company
master

搜索帮助