修改任务状态判断是否项目负责人直接查表

This commit is contained in:
kuaifan 2022-01-13 00:32:35 +08:00
parent 9594cc674f
commit a3e0d89eb0

View File

@ -512,12 +512,9 @@ class ProjectTask extends AbstractModel
throw new ApiException("当前状态[{$currentFlowItem->name}]不可流转到[{$newFlowItem->name}]"); throw new ApiException("当前状态[{$currentFlowItem->name}]不可流转到[{$newFlowItem->name}]");
} }
if ($currentFlowItem->userlimit) { if ($currentFlowItem->userlimit) {
if (!in_array(User::userid(), $currentFlowItem->userids)) { if (!in_array(User::userid(), $currentFlowItem->userids)
try { && !ProjectUser::whereProjectId($this->project_id)->whereOwner(1)->exists()) {
Project::userProject($this->project_id, true, true); throw new ApiException("当前状态[{$currentFlowItem->name}]仅限状态负责人或项目负责人修改");
} catch (Exception) {
throw new ApiException("当前状态[{$currentFlowItem->name}]仅限状态负责人或项目负责人修改");
}
} }
} }
} }