From bbc2fa0b7912e087bbd1006a55f3f5d9bc6c780e Mon Sep 17 00:00:00 2001 From: zhouxin Date: Sat, 7 Oct 2023 15:09:48 +0800 Subject: [PATCH] * Fix division by zero error in usage report. --- module/screen/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/screen/model.php b/module/screen/model.php index 60e2998884..58444d5801 100644 --- a/module/screen/model.php +++ b/module/screen/model.php @@ -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; }