* finish task #2713.

This commit is contained in:
chenfeiCF
2016-11-17 17:25:16 +08:00
parent 58693b20c3
commit 0bcb1b5cc8
6 changed files with 33 additions and 14 deletions
+14
View File
@@ -1190,6 +1190,20 @@ class taskModel extends model
$task->productType = $product->type;
}
/* Compute task progess. */
if($task->consumed == 0 and $task->left == 0)
{
$task->progess = 0;
}
elseif($task->consumed != 0 and $task->left == 0)
{
$task->progess = 100;
}
else
{
$task->progess = round($task->consumed / ($task->consumed + $task->left), 3) * 100;
}
return $task;
}