perf: 已删除任务操作文案及显示优化

This commit is contained in:
韦荣超
2022-03-11 17:42:47 +08:00
parent 7c82769448
commit c1fb67f143
2 changed files with 6 additions and 2 deletions

View File

@@ -1232,7 +1232,11 @@ class ProjectTask extends AbstractModel
$task = $builder->first();
//
if (empty($task)) {
throw new ApiException('任务不存在', [ 'task_id' => $task_id ], -4002);
if(self::whereId(intval($task_id))->withTrashed()->exists()){
throw new ApiException('任务已删除,不可编辑', [ 'task_id' => $task_id ], -4002);
}else{
throw new ApiException('任务不存在', [ 'task_id' => $task_id ], -4002);
}
}
if ($archived === true && $task->archived_at != null) {
throw new ApiException('任务已归档', [ 'task_id' => $task_id ]);