From e9302ee943c7fa7f57f4119e36ef6db8e5912e67 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Thu, 9 Nov 2023 16:02:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=A1=E6=89=B9=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Common.php | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) 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); + } }