perf: 未被领取的任务标记完成之前先领取

This commit is contained in:
kuaifan 2021-12-30 14:39:12 +08:00
parent 02361ddfb2
commit 502dd1ec1f

View File

@ -666,6 +666,9 @@ class ProjectTask extends AbstractModel
throw new ApiException('子任务未完成');
}
}
if (count($this->taskUser->where('owner', 1)) == 0) {
throw new ApiException('请先领取任务');
}
$this->complete_at = $complete_at;
$this->addLog("{任务}标记已完成:" . $this->name);
}