* If the member is not the last, can not finish task, fix bug #1939.

This commit is contained in:
daitingting
2018-07-09 16:48:29 +08:00
parent 5df4cbd69f
commit c40bfab493
+6 -3
View File
@@ -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;