diff --git a/app/api/controller/Common.php b/app/api/controller/Common.php index 6096e72..3186cfe 100644 --- a/app/api/controller/Common.php +++ b/app/api/controller/Common.php @@ -251,7 +251,7 @@ class Common extends ApiController //日常审核 $detail = Db::name('Approve')->where(['id' => $id])->find(); $subject = '一个日常审批'; - $msg_title_type = $detail['type']; + $msg_title_type = $detail['type'] ?? 0; } else if($type==2){ //报销审核 @@ -545,4 +545,31 @@ class Common extends ApiController $statistics['msg_num'] = $msg_count; $this->apiSuccess('获取成功', $statistics); } + + //获取审核步骤人员 + public function get_flow_users() + { + $param = get_params(); + if (empty($param['id'])) { + $this->apiError("审批流程id不能为空"); + } + $flow = Db::name('Flow')->where(['id' => $param['id']])->find(); + if (empty($flow)) { + $this->apiError("审批流程不存在"); + } + $flowData = unserialize($flow['flow_list']); + if(!empty($flowData)){ + foreach ($flowData as $key => &$val) { + $val['user_id_info'] = Db::name('Admin')->field('id,name,thumb')->where('id','in',$val['flow_uids'])->select()->toArray(); + } + } + $data['copy_uids'] = $flow['copy_uids']; + $data['copy_unames'] =''; + if($flow['copy_uids']!=''){ + $copy_unames = Db::name('Admin')->where('id', 'in', $flow['copy_uids'])->column('name'); + $data['copy_unames'] = implode(',', $copy_unames); + } + $data['flow_data'] = $flowData; + $this->apiSuccess('获取成功', $data); + } }