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

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

View File

@ -512,16 +512,13 @@ 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);
} catch (Exception) {
throw new ApiException("当前状态[{$currentFlowItem->name}]仅限状态负责人或项目负责人修改"); throw new ApiException("当前状态[{$currentFlowItem->name}]仅限状态负责人或项目负责人修改");
} }
} }
} }
} }
}
if ($newFlowItem->status == 'end') { if ($newFlowItem->status == 'end') {
// 判断自动完成 // 判断自动完成
if (!$this->complete_at) { if (!$this->complete_at) {