修复全科及格错误和学生数错误
This commit is contained in:
1 parent
f15a5d3f06
commit
8ccce4f9aa
3 files changed
+9
-5
No files matched your search
@@ -106,7 +106,6 @@ class Tongji extends BaseModel
|
||||
$data['cj'][$value['lieming']] = $temp;
|
||||
}
|
||||
|
||||
|
||||
$temp = $tempNull;
|
||||
$cjcol = array_column($cj, 'sum');
|
||||
$stu_cnt = count($cjcol);
|
||||
@@ -123,7 +122,6 @@ class Tongji extends BaseModel
|
||||
$temp['defenlv'] = $temp['avg'] / $sbjdefencnt;
|
||||
}
|
||||
$temp['biaozhuncha'] = round($this->getVariance($temp['avg'], $cjcol, true), 2);
|
||||
|
||||
$temp['avg'] = round($temp['avg'], 2);
|
||||
$temp['max'] = max($cjcol);
|
||||
$temp['min'] = min($cjcol);
|
||||
@@ -172,11 +170,11 @@ class Tongji extends BaseModel
|
||||
$col = 0; # 记录有成绩的学生数
|
||||
// 开始循环这个学生的每个学科成绩
|
||||
foreach ($sbj as $k => $val) {
|
||||
if (isset($value[$val['lieming']])) {
|
||||
if ($value[$val['lieming']] >= $val['fenshuxian'][$category]) {
|
||||
if (isset($value[$val['lieming'].'defen'])) {
|
||||
if ($value[$val['lieming'].'defen'] >= $val['fenshuxian'][$category]) {
|
||||
$temjige ++;
|
||||
}
|
||||
if ($value[$val['lieming']] !== null) {
|
||||
if ($value[$val['lieming'].'defen'] !== null) {
|
||||
$col ++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ class TongjiBj extends BaseModel
|
||||
|
||||
// 循环更新或写入成绩
|
||||
foreach ($temp['cj'] as $cjkey => $cj) {
|
||||
// dump($cjkey, $cj);
|
||||
$tongjiJg = $this->where('kaoshi_id', $src['kaoshi_id'])
|
||||
->where('banji_id', $val['id'])
|
||||
->where('subject_id', $cj['id'])
|
||||
@@ -265,6 +266,7 @@ class TongjiBj extends BaseModel
|
||||
,'canshilv' => $val->canshilv
|
||||
];
|
||||
}else{
|
||||
// halt($val->toArray());
|
||||
$data[$value->banji_id]['quanke'] = [
|
||||
'avg' => $val->avg
|
||||
,'jigelv' => $val->jigelv
|
||||
|
||||
@@ -81,6 +81,10 @@ class Index extends AdminBase
|
||||
// 学生数
|
||||
$con = new \app\teach\model\Banji;
|
||||
$tempsrc['ruxuenian'] = array_keys(\app\facade\Tools::nianJiNameList());
|
||||
$tempsrc['auth'] = [
|
||||
'check' => false
|
||||
,'banji_id' => array()
|
||||
];
|
||||
$bjids = $con->search($tempsrc)->column('id');
|
||||
$con = new \app\student\model\Student;
|
||||
$list['student'] = $con->where('banji_id', 'in', $bjids)
|
||||
|
||||
Reference in new issue
Block a user