* Fix division by zero error in usage report.

This commit is contained in:
zhouxin
2023-10-07 15:11:41 +08:00
parent 2bc6be0a77
commit bbc2fa0b79
+1 -1
View File
@@ -1753,7 +1753,7 @@ class screenModel extends model
$row->month = $month;
$row->totalAccount = count($teamMemberList);
$row->activeAccount = count($activeUser);
$row->ratio = number_format(($row->activeAccount/$row->totalAccount) * 100, 2) . '%';
$row->ratio = $row->totalAccount == 0 ? '0.00%' : number_format(($row->activeAccount/$row->totalAccount) * 100, 2) . '%';
$dataset[] = $row;
}