From 67f657f97571e1205d3b89d2bcd1915d0cf2d2d2 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Sat, 18 Nov 2023 17:35:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=A1=E6=A0=B8=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Common.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/app/api/controller/Common.php b/app/api/controller/Common.php index 2e281a6..d0daa23 100644 --- a/app/api/controller/Common.php +++ b/app/api/controller/Common.php @@ -603,4 +603,38 @@ class Common extends ApiController $data['flow_data'] = $flowData; $this->apiSuccess('获取成功', $data); } + + //获取审核流程节点 + public function get_flow_nodes($id=0,$type=1) + { + $flows = Db::name('FlowStep')->where(['action_id'=>$id,'type'=>$type,'delete_time'=>0])->order('sort asc')->select()->toArray(); + foreach ($flows as $key => &$val) { + $user_id_info = Db::name('Admin')->field('id,name,thumb')->where('id','in',$val['flow_uids'])->select()->toArray(); + foreach ($user_id_info as $k => &$v) { + $v['check_time'] = 0; + $v['content'] = ''; + $v['status'] = 0; + $check_array = Db::name('FlowRecord')->where(['check_user_id' => $v['id'],'step_id' => $val['id']])->order('check_time desc')->select()->toArray(); + if(!empty($check_array)){ + $checked = $check_array[0]; + $v['check_time'] = date('Y-m-d H:i', $checked['check_time']); + $v['content'] = $checked['content']; + $v['status'] = $checked['status']; + } + } + + $check_list = Db::name('FlowRecord') + ->field('f.*,a.name,a.thumb') + ->alias('f') + ->join('Admin a', 'a.id = f.check_user_id', 'left') + ->where(['f.step_id' => $val['id']])->select()->toArray(); + foreach ($check_list as $kk => &$vv) { + $vv['check_time_str'] = date('Y-m-d H:i', $vv['check_time']); + } + + $val['user_id_info'] = $user_id_info; + $val['check_list'] = $check_list; + } + $this->apiSuccess('获取成功', $flows); + } }