From c40bfab4936a9507f962273b11132220a4f30ec0 Mon Sep 17 00:00:00 2001 From: daitingting Date: Mon, 9 Jul 2018 16:48:29 +0800 Subject: [PATCH] * If the member is not the last, can not finish task, fix bug #1939. --- module/task/model.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/module/task/model.php b/module/task/model.php index 65a7fec37b..e3b517f315 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -508,9 +508,12 @@ class taskModel extends model if($currentTask->left == 0 && $oldTask->left != 0 && $currentTask->consumed != 0) { - $currentTask->status = 'done'; - $currentTask->finishedBy = $this->app->user->account; - $currentTask->finishedDate = $now; + if($oldTask->assignedTo == $teams[count($teams) - 1] && $team[$oldTask->assignedTo]->left == 0 && $team[$oldTask->assignedTo]->consumed != 0) + { + $currentTask->status = 'done'; + $currentTask->finishedBy = $this->app->user->account; + $currentTask->finishedDate = $now; + } } return $currentTask;