更新审核机制

This commit is contained in:
yaooo 2023-11-18 11:55:31 +08:00
parent 901602acf9
commit b6afb6840d
2 changed files with 41 additions and 1 deletions

View File

@ -147,6 +147,46 @@ class OaApprove extends ApiController
} }
$flow_list = Db::name('Flow')->where('id',$param['flow_id'])->value('flow_list'); $flow_list = Db::name('Flow')->where('id',$param['flow_id'])->value('flow_list');
$flow = unserialize($flow_list); $flow = unserialize($flow_list);
foreach($flow as $item) {
// 当前部门负责人
if ($item['flow_type'] == 1) {
$manager_id = Db::name('department')->where('id', $this->did)->value('manager_id');
if (empty($manager_id)) {
return to_assign(1,'当前部门负责人不存在');
}
}
// 上一级部门负责人
if ($item['flow_type'] == 2) {
$pid = Db::name('department')->where('id', $this->did)->value('pid');
if (empty($pid)) {
return to_assign(1,'上一级部门不存在');
}
$manager_id = Db::name('department')->where('id', $pid)->value('manager_id');
if (empty($manager_id)) {
return to_assign(1,'上一级部门负责人不存在');
}
}
// 当前部门分管领导
if ($item['flow_type'] == 5) {
$leader_id = Db::name('department')->where('id', $this->did)->value('leader_id');
if (empty($leader_id)) {
return to_assign(1,'当前部门分管领导不存在');
}
}
// 上一级部门分管领导
if ($item['flow_type'] == 6) {
$pid = Db::name('department')->where('id', $this->did)->value('pid');
if (empty($pid)) {
return to_assign(1,'上一级部门不存在');
}
$leader_id = Db::name('department')->where('id', $pid)->value('leader_id');
if (empty($leader_id)) {
return to_assign(1,'当前部门分管领导不存在');
}
}
}
if (!empty($param['id']) && $param['id'] > 0) { if (!empty($param['id']) && $param['id'] > 0) {
$param['update_time'] = time(); $param['update_time'] = time();
$param['check_status'] = 0; $param['check_status'] = 0;

View File

@ -293,7 +293,7 @@ class Approve extends BaseController
} }
} }
halt($flow, $this->uid, $this->did);
if ($param['id'] > 0) { if ($param['id'] > 0) {
$param['update_time'] = time(); $param['update_time'] = time();
$param['check_status'] = 0; $param['check_status'] = 0;