perf 优化发给抄送人信息

This commit is contained in:
ganzizi 2023-04-21 09:25:20 +08:00
parent b860a749f3
commit 9203046d97

View File

@ -994,29 +994,17 @@ class WorkflowController extends AbstractController
{
// 获取流程节点
$process_node = $process['node_infos'];
// 如果流程开始就直接审核结束,则循环往上找所有推送人
if ($process['is_finished'] == true && $step == 0) {
$notifier = [];
foreach ($process_node as $key => $val) {
if ($val['type'] == 'notifier') {
$notifier = array_merge($notifier, $val['node_user_list']);
}
// 节点到最后时,跳出循环
if ($key == count($process_node) - 1) {
break;
}
$notifier = [];
foreach ($process_node as $key => $val) {
if ($val['type'] == 'notifier') {
$notifier = array_merge($notifier, $val['node_user_list']);
}
// 判断到达的节点
if ($process['node_id'] == $val['node_id']) {
break;
}
return array_unique($notifier, SORT_REGULAR) ?? [];
}
//判断下一步是否有抄送人
$step = $step + 1;
$next_node = $process_node[$step] ?? [];
if ($next_node) {
if ($next_node['type'] == 'notifier'){
return $next_node['node_user_list'] ?? [];
}
}
return [];
return array_unique($notifier, SORT_REGULAR) ?? [];
}
// 根据ID查询流程实例的参与者所有