perf: 优化子任务读取失败

This commit is contained in:
kuaifan
2024-09-13 05:40:44 +03:00
parent 0d23b973de
commit 050c9702d8
2 changed files with 5 additions and 1 deletions

View File

@@ -1278,7 +1278,9 @@ class ProjectTask extends AbstractModel
// 标记已完成
if ($this->parent_id == 0) {
if (self::whereParentId($this->id)->whereCompleteAt(null)->exists()) {
throw new ApiException('子任务未完成');
throw new ApiException('子任务未完成', [
'task_id' => $this->id
], -4004);
}
}
if (!$this->hasOwner()) {