更新细节

This commit is contained in:
yaooo 2023-11-20 14:58:16 +08:00
parent 40f7003c18
commit b854deeaf1
1 changed files with 9 additions and 13 deletions

View File

@ -233,16 +233,9 @@ class Common extends ApiController
if (empty($param['check'])) { if (empty($param['check'])) {
$this->apiError("审批状态不能为空"); $this->apiError("审批状态不能为空");
} }
if ($param['check'] != 3) { if (!in_array($param['check'], [1, 2, 3])) {
if (empty($param['content'])) { $this->apiError("审批状态参数错误");
$this->apiError("审批内容不能为空"); }
}
//1审核结束 2下一审批人
if (empty($param['check_node'])) {
$this->apiError("审批节点不能为空");
}
}
$id = $param['id']; $id = $param['id'];
$type = $param['type']; $type = $param['type'];
$detail = []; $detail = [];
@ -250,6 +243,9 @@ class Common extends ApiController
if($type==1){ if($type==1){
//日常审核 //日常审核
$detail = Db::name('Approve')->where(['id' => $id])->find(); $detail = Db::name('Approve')->where(['id' => $id])->find();
if (empty($detail)){
$this->apiError("审批数据错误");
}
$subject = '一个日常审批'; $subject = '一个日常审批';
$msg_title_type = $detail['type'] ?? 0; $msg_title_type = $detail['type'] ?? 0;
} }
@ -406,7 +402,7 @@ class Common extends ApiController
'type' => $type, 'type' => $type,
'check_time' => time(), 'check_time' => time(),
'status' => $param['check'], 'status' => $param['check'],
'content' => $param['content'], 'content' => $param['content'] ?? '',
'create_time' => time() 'create_time' => time()
); );
$aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); $aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData);
@ -482,7 +478,7 @@ class Common extends ApiController
'type' => $type, 'type' => $type,
'check_time' => time(), 'check_time' => time(),
'status' => $param['check'], 'status' => $param['check'],
'content' => $param['content'], 'content' => $param['content'] ?? '',
'create_time' => time() 'create_time' => time()
); );
$aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); $aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData);
@ -534,7 +530,7 @@ class Common extends ApiController
'type' => $type, 'type' => $type,
'check_time' => time(), 'check_time' => time(),
'status' => $param['check'], 'status' => $param['check'],
'content' => $param['content'], 'content' => $param['content'] ?? '',
'create_time' => time() 'create_time' => time()
); );
$aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData); $aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData);