summaryrefslogtreecommitdiff
path: root/app/Model/ProjectAnalytic.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Model/ProjectAnalytic.php')
-rw-r--r--app/Model/ProjectAnalytic.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/Model/ProjectAnalytic.php b/app/Model/ProjectAnalytic.php
index b62248eb..46f2242d 100644
--- a/app/Model/ProjectAnalytic.php
+++ b/app/Model/ProjectAnalytic.php
@@ -34,6 +34,10 @@ class ProjectAnalytic extends Base
);
}
+ if ($total === 0) {
+ return array();
+ }
+
foreach ($metrics as &$metric) {
$metric['percentage'] = round(($metric['nb_tasks'] * 100) / $total, 2);
}
@@ -71,6 +75,10 @@ class ProjectAnalytic extends Base
$metrics[$user]['nb_tasks']++;
}
+ if ($total === 0) {
+ return array();
+ }
+
foreach ($metrics as &$metric) {
$metric['percentage'] = round(($metric['nb_tasks'] * 100) / $total, 2);
}