From c518033e8df2ffed670332c91aae7a6469b6fac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=BA=E5=93=A5?= Date: Tue, 26 Oct 2021 09:47:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9C=AA=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=88=90=E7=BB=A9=E6=9F=A5=E7=9C=8B=E6=8A=A5=E5=91=8A=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=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 | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/tools/model/OneStudentChengji.php b/app/tools/model/OneStudentChengji.php index 42cc8660..e7fc6e28 100755 --- a/app/tools/model/OneStudentChengji.php +++ b/app/tools/model/OneStudentChengji.php @@ -440,9 +440,14 @@ class OneStudentChengji extends BaseModel ,'bweizhi' => $value->bweizhi ,'xweizhi' => $value->xweizhi ,'qweizhi' => $value->qweizhi - ,'max' => $schtjInfo[$value->subject_id]['max'] - ,'min' => $schtjInfo[$value->subject_id]['min'] ]; + if (count($schtjInfo) > 0) { + $data[$key]['max'] = $schtjInfo[$value->subject_id]['max']; + $data[$key]['min'] = $schtjInfo[$value->subject_id]['min']; + } else { + $data[$key]['max'] = '未统计'; + $data[$key]['min'] = '未统计'; + } if($cjDengji === false) { $data[$key]['defen'] = $this->toDengji($mf[$value->subject_id], $value->defen); @@ -742,6 +747,10 @@ class OneStudentChengji extends BaseModel $btCj = $btj->where('kaoshi_id', $src['kaoshi_id']) ->where('banji_id', $src['banji_id']) ->select(); + if($btCj->isEmpty()) + { + return ''; + } $avg = array(); foreach ($btCj as $key => $value) { $avg[$value->subject_id] = $value->avg;