From 276198774ee87d671e4787bea51b4ed2d5f9ee32 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 9 May 2023 20:32:56 +0800 Subject: [PATCH] * Reduce the number of conditional operators. --- module/task/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/task/model.php b/module/task/model.php index dbbfbe7a48..49e8c4b63d 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -1441,7 +1441,8 @@ class taskModel extends model $currentTeam = $this->getTeamByAccount($task->team, $this->app->user->account, $extra); } - if(!$newTask->left and ((empty($currentTeam) and in_array($task->status, array('done', 'cancel', 'closed'))) or (!empty($currentTeam) and $currentTeam->status != 'done'))) + $isFinishTask = (empty($currentTeam) && !in_array($task->status, $this->config->task->unfinishedStatus)) || (!empty($currentTeam) && $currentTeam->status != 'done'); + if(!$newTask->left && $isFinishTask) { $newTask->status = 'done'; $newTask->assignedTo = $task->openedBy;