From 092f6523e7879e88020a3f5471921dc7b5bbff87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=BA=E5=93=A5?= Date: Mon, 18 Oct 2021 12:28:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B9=B3=E5=9D=87=E5=88=86?= =?UTF-8?q?=E4=B8=BA0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/tools/model/OneStudentChengji.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/tools/model/OneStudentChengji.php b/app/tools/model/OneStudentChengji.php index 909daca8..3980be7d 100755 --- a/app/tools/model/OneStudentChengji.php +++ b/app/tools/model/OneStudentChengji.php @@ -96,7 +96,7 @@ class OneStudentChengji extends BaseModel $defen = array_column($value->ksChengji->toArray(), 'defen'); $sum = array_sum($defen ); - $avg = $sum / $cjcnt; + $cjcnt > 0 ? $avg = $sum / $cjcnt : $avg = ""; $data[$key]['sum'] = $sum; $data[$key]['avg'] = round($avg,2); }