From a3e0d89eb0f4e75bc58108521e99aae30392653d Mon Sep 17 00:00:00 2001 From: kuaifan Date: Thu, 13 Jan 2022 00:32:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=BB=E5=8A=A1=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E8=B4=9F=E8=B4=A3=E4=BA=BA=E7=9B=B4=E6=8E=A5=E6=9F=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/ProjectTask.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/Models/ProjectTask.php b/app/Models/ProjectTask.php index bc487cc3..a7ba74c2 100644 --- a/app/Models/ProjectTask.php +++ b/app/Models/ProjectTask.php @@ -512,12 +512,9 @@ class ProjectTask extends AbstractModel throw new ApiException("当前状态[{$currentFlowItem->name}]不可流转到[{$newFlowItem->name}]"); } if ($currentFlowItem->userlimit) { - if (!in_array(User::userid(), $currentFlowItem->userids)) { - try { - Project::userProject($this->project_id, true, true); - } catch (Exception) { - throw new ApiException("当前状态[{$currentFlowItem->name}]仅限状态负责人或项目负责人修改"); - } + if (!in_array(User::userid(), $currentFlowItem->userids) + && !ProjectUser::whereProjectId($this->project_id)->whereOwner(1)->exists()) { + throw new ApiException("当前状态[{$currentFlowItem->name}]仅限状态负责人或项目负责人修改"); } } }