更新审核流程

This commit is contained in:
yaooo 2023-11-18 17:35:14 +08:00
parent de93bf4311
commit 67f657f975
1 changed files with 34 additions and 0 deletions

View File

@ -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);
}
}