From 9203046d970782c5152abebe3952e110213fdbb1 Mon Sep 17 00:00:00 2001 From: ganzizi Date: Fri, 21 Apr 2023 09:25:20 +0800 Subject: [PATCH] =?UTF-8?q?perf=20=E4=BC=98=E5=8C=96=E5=8F=91=E7=BB=99?= =?UTF-8?q?=E6=8A=84=E9=80=81=E4=BA=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Api/WorkflowController.php | 30 ++++++------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/app/Http/Controllers/Api/WorkflowController.php b/app/Http/Controllers/Api/WorkflowController.php index e5e1a848f..b807c72d8 100755 --- a/app/Http/Controllers/Api/WorkflowController.php +++ b/app/Http/Controllers/Api/WorkflowController.php @@ -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查询流程实例的参与者(所有)