diff --git a/README.md b/README.md
index b2995a28..835f85dc 100755
--- a/README.md
+++ b/README.md
@@ -33,7 +33,7 @@
* 查看成绩统计结果(表格+统计表)
* 查看学生历次成绩(表格+统计表+报告)
* 管理员、教师和学生不同身份的登录
-* 设置网页显示统计结果项目(超级管理员可操作)
+* 设置统计项目
## 界面及功能展示
@@ -195,4 +195,4 @@ https://www.kancloud.cn/llblax/abcd/789222
* [ ] 想一想接下来要干点什么……
## 感谢
-这个项目一直在更新和完善,在这个磕磕绊绊的成长过程中得到了许多朋友、同仁的支持和肯定,特别是水月居、哒哒达、洁、王兵hb、不一样、sunz_7和在码云评论区及时反馈问题的朋友们,有了你们的建议和反馈才让这个项目的功能更加完善,同时也感谢留下Watch、Star、Fork的朋友们,不断增加的Watch、Star、Fork也是让我坚持下去的动力源泉。
+这个项目一直在更新和完善,在这个磕磕绊绊的成长过程中得到了许多朋友、同仁的支持和肯定,特别是水月居、哒哒达、洁、王兵hb、不一样、sunz_7、小白和在码云评论区及时反馈问题的朋友们,有了你们的建议和反馈才让这个项目的功能更加完善,同时也感谢留下Watch、Star、Fork的朋友们,不断增加的Star也是让我坚持下去的动力源泉。
diff --git a/app/chengji/controller/Bjtongji.php b/app/chengji/controller/Bjtongji.php
index c05013ed..aac90fad 100755
--- a/app/chengji/controller/Bjtongji.php
+++ b/app/chengji/controller/Bjtongji.php
@@ -174,12 +174,7 @@ class Bjtongji extends AdminBase
->setCategory("成绩管理"); //分类
// 设置要导出的项目、列名、起始行
- $sbjcol = [
- 'chengji_cnt' => '人数'
- ,'avg' => '平均分'
- ,'jigelv' => '及格率%'
- ,'youxiulv' => '优秀率%'
- ];
+ $sbjcol = srcTjxm(12202);
$sbjcolcnt = count($sbjcol);
$colname = excelColumnName();
$colcnt = $sbjcolcnt*count($xk)+3;
@@ -188,7 +183,7 @@ class Bjtongji extends AdminBase
$sheet->mergeCells('A1:' . $colname[$colcnt] . '1');
$sheet->setCellValue('A1', $tabletitle);
$sheet->mergeCells('A2:' . $colname[$colcnt] . '2');
- $sheet->setCellValue('A2', '考试时间:' . $ksinfo->bfdate . ' ~ '. $ksinfo->enddate);
+ $sheet->setCellValue('A2', '考试时间:' . $ksinfo->bfdate . ' ~ '. $ksinfo->enddate);
$sheet->mergeCells('A3:A4');
$sheet->setCellValue('A3', '序号');
$sheet->mergeCells('B3:B4');
@@ -199,7 +194,7 @@ class Bjtongji extends AdminBase
$sheet->mergeCells($colname[$col].'3:'.$colname[$colend].'3');
$sheet->setCellValue($colname[$col].'3', $value['title'].' ('.$value['fenshuxian']['manfen'].')');
foreach ($sbjcol as $k => $val) {
- $sheet->setCellValue($colname[$col].'4', $val);
+ $sheet->setCellValue($colname[$col].'4', $val['title']);
$col++;
}
}
@@ -225,7 +220,7 @@ class Bjtongji extends AdminBase
foreach ($xk as $ke => $val) {
foreach ($sbjcol as $k => $v) {
- $sheet->setCellValue($colname[$col].$row, $value['chengji'][$val['lieming']][$k]);
+ $sheet->setCellValue($colname[$col].$row, $value['chengji'][$val['lieming']][$v['biaoshi']]);
$col++;
}
}
diff --git a/app/chengji/controller/Index.php b/app/chengji/controller/Index.php
index dd518cc9..16da3de0 100755
--- a/app/chengji/controller/Index.php
+++ b/app/chengji/controller/Index.php
@@ -29,6 +29,7 @@ class Index extends AdminBase
$list['set']['school_id'] = $cy->school($src);
$list['kaoshi_id'] = $kaoshi_id;
$list['dataurl'] = '/chengji/index/data';
+ $list['tjxm'] = srcTjxm(12205);
// 模板赋值
$this->view->assign('list', $list);
@@ -252,6 +253,8 @@ class Index extends AdminBase
$chengjiinfo = $more->srcChengjiList($src);
$ksset = new \app\kaoshi\model\KaoshiSet;
$subject_id = $ksset->srcSubject($src);
+ $tjxm_left = srcTjxm(12210);
+ $tjxm_right = srcTjxm(12206);
// 获取考试标题
$ks = new \app\kaoshi\model\Kaoshi;
@@ -281,57 +284,75 @@ class Index extends AdminBase
// 设置表头信息
- $sheet->setCellValue('A1', $tabletitle);
- $hb = 5 + count($subject_id);
- $sheet->mergeCells('A1:' . $colname[$hb] . '1');
- $sheet->mergeCells('A2:' . $colname[$hb] . '2');
- $sheet->setCellValue('A2', '考试时间:' . $ks->bfdate . ' ~ '. $ks->enddate);
- $sheet->setCellValue('A3', '序号');
- $sheet->setCellValue('B3', '班级');
- $sheet->setCellValue('C3', '姓名');
- $sheet->setCellValue('D3', '性别');
- $i = 4;
+ $row = 1;
+ $sheet->setCellValue('A' . $row, $tabletitle);
+ $row ++;
+ $sheet->setCellValue('A' . $row, '考试时间:' . $ks->bfdate . ' ~ '. $ks->enddate);
+ $row ++;
+ $sheet->setCellValue('A' . $row, '序号');
+ $sheet->setCellValue('B' . $row, '班级');
+ $sheet->setCellValue('C' . $row, '姓名');
+ $sheet->setCellValue('D' . $row, '性别');
+ $i = 4; # 跳过上面4列
foreach ($subject_id as $key => $value) {
- $sheet->setCellValue($colname[$i] . '3', $value['title']);
+ $sheet->setCellValue($colname[$i] . $row, $value['title']);
$i ++;
+ foreach ($tjxm_left as $tjxml_k => $tjxml_v) {
+ $sheet->setCellValue($colname[$i] . $row, $value['title'] . $tjxml_v['title']);
+ $i ++;
+ }
}
- $sheet->setCellValue($colname[$i] . '3', '平均分');
- $sheet->setCellValue($colname[$i + 1] . '3', '总分');
- $i = $i + 4;
- $sheet->setCellValue($colname[$i] . '3', '项目');
- $sheet->setCellValue($colname[$i] . '4', '人数');
- $sheet->setCellValue($colname[$i] . '5', '平均分');
- $sheet->setCellValue($colname[$i] . '6', '优秀率%');
- $sheet->setCellValue($colname[$i] . '7', '及格率%');
- $sheet->setCellValue($colname[$i] . '8', '标准差');
- $sheet->setCellValue($colname[$i] . '9', '中位数');
- $sheet->setCellValue($colname[$i] . '10', '众数');
+ $sheet->setCellValue($colname[$i] . '3', '平均分');
+ $i ++;
+ $sheet->setCellValue($colname[$i] . '3', '总分');
+ $sheet->mergeCells('A1:' . $colname[$i] . '1'); # 合并标题行
+ $sheet->mergeCells('A2:' . $colname[$i] . '2'); # 合并时间行
+ $col_null = 3; # 统计结果与成绩列表空两列
+ $i = $i + $col_null;
+
+ $sheet->setCellValue($colname[$i] . $row, '项目');
+ $row_temp = $row + 1;
+ foreach ($tjxm_right as $tjxmr_k => $tjxmr_v) {
+ $sheet->setCellValue($colname[$i] . $row_temp, $tjxmr_v['title']);
+ $row_temp++;
+ }
$i ++;
foreach ($subject_id as $key => $value) {
- $sheet->setCellValue($colname[$i] . '3', $value['title']);
+ $sheet->setCellValue($colname[$i] . $row, $value['title']);
$i ++;
}
// 循环写出成绩及个人信息
- $i = 4;
+ $i = 0;
+ $row++;
+ $row_temp = $row;
foreach ($chengjiinfo as $key => $value) {
+ $i = 0;
// 表格赋值
- $sheet->setCellValue('A' . $i, $i - 2);
- $sheet->setCellValue('B' . $i, $value['banji_title']);
- $sheet->setCellValue('C' . $i, $value['student_xingming']);
- $sheet->setCellValue('D' . $i, $value['sex']);
- $colcnt = 4;
+ $sheet->setCellValue($colname[$i] . $row_temp, $row_temp - 3);
+ $i++;
+ $sheet->setCellValue($colname[$i] . $row_temp, $value['banji_title']);
+ $i++;
+ $sheet->setCellValue($colname[$i] . $row_temp, $value['student_xingming']);
+ $i++;
+ $sheet->setCellValue($colname[$i] . $row_temp, $value['sex']);
+ $i++;
foreach ($subject_id as $k => $val) {
- if(isset($value[$val['lieming']]))
+ if(isset($value[$val['lieming']]['defen']))
{
- $sheet->setCellValue($colname[$colcnt] . $i, $value[$val['lieming']]);
+ $sheet->setCellValue($colname[$i] . $row_temp, $value[$val['lieming']]['defen']);
+ $i++;
+ foreach ($tjxm_left as $tjxml_k => $tjxml_v) {
+ $sheet->setCellValue($colname[$i] . $row_temp, $value[$val['lieming']][$tjxml_v['biaoshi']]);
+ $i++;
+ }
}
- $colcnt ++;
}
- $sheet->setCellValue($colname[$colcnt] . $i, $value['avg']);
- $sheet->setCellValue($colname[$colcnt + 1] . $i, $value['sum']);
- $i ++;
+ $sheet->setCellValue($colname[$i] . $row_temp, $value['avg']);
+ $i++;
+ $sheet->setCellValue($colname[$i] . $row_temp, $value['sum']);
+ $row_temp++;
}
// 表格格式
@@ -341,14 +362,14 @@ class Index extends AdminBase
'vertical' => \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER, //垂直居中
],
];
- $sheet->getStyle('A1:'.$colname[$colcnt + 1] . ($i - 1))->applyFromArray($styleArrayJZ);
- // 表格格式
- $styleArrayJZ = [ # 居中
+ $sheet->getStyle('A1:'.$colname[$i] . $row_temp)->applyFromArray($styleArrayJZ);
+ // 考试时间居左 表格格式
+ $styleArrayJZ = [ # 居左
'alignment' => [
'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT,
],
];
- $sheet->getStyle('A2:'.$colname[$colcnt + 1] . ($i - 1))->applyFromArray($styleArrayJZ);
+ $sheet->getStyle('A2')->applyFromArray($styleArrayJZ);
$styleArrayBK = [ # 加边框
'borders' => [
'allBorders' => [
@@ -357,44 +378,44 @@ class Index extends AdminBase
],
],
];
- $sheet->getStyle('A3:'.$colname[$colcnt + 1] . ($i - 1))->applyFromArray($styleArrayBK);
+ $sheet->getStyle('A3:'.$colname[$i] . ($row_temp - 1))->applyFromArray($styleArrayBK);
$tj = new \app\chengji\model\Tongji;
+
$temp = $tj->tongjiSubject($chengjiinfo, $subject_id);
- isset($colcnt) ? $colcnt = $colcnt + 5 : $colcnt = 12;
- $colBiankuang = $colcnt;
+ // 左侧开始列
+ $i = $i + $col_null ;
+ $col_r = $i;
+
// 循环写出统计结果
foreach ($subject_id as $key => $value) {
- $xkcnt = $temp['cj'][$value['lieming']]['xkcnt'];
- if ($xkcnt > 0 ) {
- $youxiulv = round($temp['cj'][$value['lieming']]['youxiu'] / $xkcnt * 100, 2);
- $jigelv = round($temp['cj'][$value['lieming']]['jige'] / $xkcnt * 100, 2);
+ $i ++;
+ $row_temp = $row;
+ $chengji_cnt = $temp['cj'][$value['lieming']]['chengji_cnt'];
+ if ($chengji_cnt > 0 ) {
+ $temp['cj'][$value['lieming']]['youxiulv'] = round($temp['cj'][$value['lieming']]['youxiu'] / $chengji_cnt * 100, 2);
+ $temp['cj'][$value['lieming']]['jigelv'] = round($temp['cj'][$value['lieming']]['jige'] / $chengji_cnt * 100, 2);
} else {
- $youxiulv = 0;
- $jigelv = 0;
+ $temp['cj'][$value['lieming']]['youxiulv'] = 0;
+ $temp['cj'][$value['lieming']]['jigelv'] = 0;
+ }
+ foreach ($tjxm_right as $tjxmr_k => $tjxmr_v) {
+ $sheet->setCellValue($colname[$i] . $row_temp, $temp['cj'][$value['lieming']][$tjxmr_v['biaoshi']]);
+ $row_temp++;
}
-
- $sheet->setCellValue($colname[$colcnt] . '4', $temp['cj'][$value['lieming']]['xkcnt']);
- $sheet->setCellValue($colname[$colcnt] . '5', $temp['cj'][$value['lieming']]['avg']);
-
- $sheet->setCellValue($colname[$colcnt] . '6', $youxiulv);
- $sheet->setCellValue($colname[$colcnt] . '7', $jigelv);
- $sheet->setCellValue($colname[$colcnt] . '8', $temp['cj'][$value['lieming']]['biaozhuncha']);
- $sheet->setCellValue($colname[$colcnt] . '9', $temp['cj'][$value['lieming']]['zhongweishu']);
- $sheet->setCellValue($colname[$colcnt] . '10', $temp['cj'][$value['lieming']]['zhongshu']);
- $colcnt ++;
}
- $sheet->setCellValue($colname[$colBiankuang - 1] . '11', '总平均分');
- $sheet->setCellValue($colname[$colBiankuang] . '11', $temp['cj']['all']['avg']);
- $sheet->mergeCells($colname[$colBiankuang] . '11:' . $colname[$colcnt - 1] . '11');
- $sheet->setCellValue($colname[$colBiankuang - 1] . '12', '全科及格率%');
- $sheet->setCellValue($colname[$colBiankuang] . '12', $temp['cj']['all']['jigelv']);
- $sheet->mergeCells($colname[$colBiankuang] . '12:' . $colname[$colcnt - 1] . '12');
- $sheet->getStyle($colname[$colBiankuang - 1] . '3:' . $colname[$colcnt - 1] . '12')->applyFromArray($styleArrayJZ);
- $sheet->getStyle($colname[$colBiankuang - 1] . '3:' . $colname[$colcnt - 1] . '12')->applyFromArray($styleArrayBK);
+ $sheet->setCellValue($colname[$col_r] . $row_temp, '总平均分');
+ $sheet->setCellValue($colname[$col_r + 1] . $row_temp, $temp['cj']['all']['avg']);
+ $sheet->mergeCells($colname[$col_r + 1] . $row_temp . ':' . $colname[$i] . $row_temp);
+ $row_temp++;
+ $sheet->setCellValue($colname[$col_r] . $row_temp, '全科及格率%');
+ $sheet->setCellValue($colname[$col_r + 1] . $row_temp, $temp['cj']['all']['jigelv']);
+ $sheet->mergeCells($colname[$col_r + 1] . $row_temp . ':' . $colname[$i] . $row_temp);
+ $sheet->getStyle($colname[$col_r] . ($row - 1) . ':' . $colname[$i] . $row_temp)->applyFromArray($styleArrayJZ);
+ $sheet->getStyle($colname[$col_r] . ($row - 1) . ':' . $colname[$i] . $row_temp)->applyFromArray($styleArrayBK);
$sheet->getStyle('A1')->getFont()->setBold(true)->setName('宋体')->setSize(16); # 修改标题字号
@@ -403,7 +424,7 @@ class Index extends AdminBase
$sheet->getDefaultColumnDimension()->setWidth(9); # 设置列宽
$sheet->getColumnDimension('A')->setWidth(6);
$sheet->getColumnDimension('B')->setWidth(12);
- $sheet->getColumnDimension($colname[$colBiankuang-1])->setWidth(13);
+ $sheet->getColumnDimension($colname[$i])->setWidth(13);
// 页面设置
$sheet->getPageSetup()->setOrientation(\PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE);
diff --git a/app/chengji/controller/Njtongji.php b/app/chengji/controller/Njtongji.php
index 10faeb25..8fad5f4e 100755
--- a/app/chengji/controller/Njtongji.php
+++ b/app/chengji/controller/Njtongji.php
@@ -150,12 +150,7 @@ class Njtongji extends AdminBase
->setCategory("成绩管理"); //分类
// 设置导出项目、列表等
- $sbjcol = [
- 'cjCnt' => '人数'
- ,'avg' => '平均分'
- ,'jigelv' => '及格率%'
- ,'youxiulv' => '优秀率%'
- ];
+ $sbjcol = srcTjxm(12204);
$sbjcolcnt = count($sbjcol);
$colname = excelColumnName();
$colcnt = $sbjcolcnt * count($xk) + 3;
@@ -175,7 +170,7 @@ class Njtongji extends AdminBase
$sheet->mergeCells($colname[$col] . '3:' . $colname[$colend] . '3');
$sheet->setCellValue($colname[$col] . '3', $value['title'] . ' (' . $value['fenshuxian']['manfen'] . ')');
foreach ($sbjcol as $k => $val) {
- $sheet->setCellValue($colname[$col] . '4', $val);
+ $sheet->setCellValue($colname[$col] . '4', $val['title']);
$col++;
}
}
@@ -194,8 +189,8 @@ class Njtongji extends AdminBase
$sheet->setCellValue('B' . $row, $value['school_jiancheng']);
foreach ($xk as $ke => $val) {
foreach ($sbjcol as $k => $v) {
- $sheet->setCellValue($colname[$col] . $row, $value['chengji'][$val['lieming']][$k]);
- $col ++;
+ $sheet->setCellValue($colname[$col] . $row, $value['chengji'][$val['lieming']][$v['biaoshi']]);
+ $col ++;
}
}
$sheet->setCellValue($colname[$col] . $row, $value['quanke']['jigelv']);
diff --git a/app/chengji/model/Chengji.php b/app/chengji/model/Chengji.php
index 1984fdf6..7da1257f 100755
--- a/app/chengji/model/Chengji.php
+++ b/app/chengji/model/Chengji.php
@@ -174,12 +174,13 @@ class Chengji extends BaseModel
,'defen' => $value->defen
,'defenlv' => $value->defenlv
,'bpaixu' => $value->bpaixu
- ,'xpaixu' => $value->xpaixu
,'bweizhi' => $value->bweizhi
+ ,'xpaixu' => $value->xpaixu
,'xweizhi' => $value->xweizhi
-
+ ,'qpaixu' => $value->qpaixu
+ ,'qweizhi' => $value->qweizhi
];
- $value->cjKaohao->cjStudent ? $data[$key]['student_name']=$value->cjKaohao->cjStudent->xingming : $data[$key]['student_name']= '';
+ $value->cjKaohao->cjStudent ? $data[$key]['student_name'] = $value->cjKaohao->cjStudent->xingming : $data[$key]['student_name'] = '';
}
return $data;
diff --git a/app/chengji/model/Tongji.php b/app/chengji/model/Tongji.php
index 9f1f950c..f928be31 100755
--- a/app/chengji/model/Tongji.php
+++ b/app/chengji/model/Tongji.php
@@ -32,7 +32,7 @@ class Tongji extends BaseModel
{
// 设置默认值
$tempNull = [
- 'xkcnt' => 0
+ 'chengji_cnt' => 0
,'sum' => null
,'biaozhuncha' => null
,'avg' => null
@@ -43,11 +43,16 @@ class Tongji extends BaseModel
,'1' => null
,'2' => null
]
+ ,'q1' => 0
+ ,'q2' => 0
+ ,'q3' => 0
,'max' => null
,'min' => null
,'zhongshu' => null
,'zhongweishu' => null
,'defenlv' => null
+ ,'chashenglv' => 0
+ ,'canshilv' => 0
];
$data = array();
@@ -55,22 +60,25 @@ class Tongji extends BaseModel
// 循环统计各学科成绩
foreach ($subject as $key => $value) {
+ $cjcol = array();
$sbjdefencnt = $sbjdefencnt + $value['fenshuxian']['manfen'];
- $cjcol = array_column($cj,$value['lieming']);
- $stucnt = count($cjcol);
+ foreach ($cj as $cj_k => $cj_v) {
+ $cjcol[] = $cj_v[$value['lieming']]['defen'];
+ }
+ $stu_cnt = count($cjcol);
$cjcol = array_filter($cjcol, function($item){
return $item !== null;
});
$temp = $tempNull;
$temp['id'] = $value['id'];
- $temp['stucnt'] = $stucnt;
+ $temp['stu_cnt'] = $stu_cnt;
if($cjcol != null) {
- $temp['xkcnt'] = count($cjcol);
+ $temp['chengji_cnt'] = count($cjcol);
$temp['sum'] = array_sum($cjcol);
- if ($temp['xkcnt'] > 0) {
- $temp['avg'] = $temp['sum'] / $temp['xkcnt'];
+ if ($temp['chengji_cnt'] > 0) {
+ $temp['avg'] = $temp['sum'] / $temp['chengji_cnt'];
$temp['defenlv'] = $temp['avg'] / $value['fenshuxian']['manfen'];
}
$temp['biaozhuncha'] = round($this->getVariance($temp['avg'], $cjcol, true), 2);
@@ -80,9 +88,15 @@ class Tongji extends BaseModel
$temp['max'] = max($cjcol);
$temp['min'] = min($cjcol);
$temp['sifenwei'] = $this->myquartile($cjcol);
+ $temp['q1'] = $temp['sifenwei'][0];
+ $temp['q2'] = $temp['sifenwei'][1];
+ $temp['q3'] = $temp['sifenwei'][2];
$temp['zhongshu'] = $this->zhongshu($cjcol);
$temp['zhongweishu'] = $this->zhongweishu($cjcol);
$temp['defenlv'] = round($temp['defenlv'] * 100, 2);
+ $temp['canshilv'] = round($temp['chengji_cnt'] / $temp['stu_cnt'] * 100, 2);
+ $temp['chashenglv'] = round(($temp['chengji_cnt'] - $temp['jige']) / $temp['chengji_cnt'] * 100, 2);
+
}
$data['cj'][$value['lieming']] = $temp;
}
@@ -90,31 +104,37 @@ class Tongji extends BaseModel
$temp = $tempNull;
$cjcol = array_column($cj, 'sum');
- $stucnt = count($cjcol);
+ $stu_cnt = count($cjcol);
$cjcol = array_filter($cjcol, function ($item) {
return $item !== null;
});
$temp['id'] = 0;
- $temp['stucnt'] = $stucnt;
+ $temp['stu_cnt'] = $stu_cnt;
if ($cjcol != null) {
- $temp['xkcnt'] = count($cjcol); # 报名人数
+ $temp['chengji_cnt'] = count($cjcol); # 报名人数
$temp['sum'] = array_sum($cjcol);
- if( $temp['xkcnt'] > 0) {
- $temp['avg'] = $temp['sum'] / $temp['xkcnt'];
+ if( $temp['chengji_cnt'] > 0) {
+ $temp['avg'] = $temp['sum'] / $temp['chengji_cnt'];
$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);
$temp['youxiu'] = $this->rateAll($cj, $subject, 'youxiu');
$temp['jige'] = $this->rateAll($cj, $subject, 'jige'); #全科及格率
$temp['sifenwei'] = $this->myquartile($cjcol);
+ $temp['q1'] = $temp['sifenwei'][0];
+ $temp['q2'] = $temp['sifenwei'][1];
+ $temp['q3'] = $temp['sifenwei'][2];
$temp['zhongshu'] = $this->zhongshu($cjcol);
$temp['zhongweishu'] = $this->zhongweishu($cjcol);
$temp['defenlv'] = round($temp['defenlv'] * 100, 2);
- $temp['youxiulv'] = round($temp['youxiu'] / $temp['xkcnt'] * 100, 2);
- $temp['jigelv'] = round($temp['jige'] / $temp['xkcnt'] * 100, 2);
+ $temp['youxiulv'] = round($temp['youxiu'] / $temp['chengji_cnt'] * 100, 2);
+ $temp['jigelv'] = round($temp['jige'] / $temp['chengji_cnt'] * 100, 2);
+ $temp['canshilv'] = round($temp['chengji_cnt'] / $temp['stu_cnt'] * 100, 2);
+ $temp['chashenglv'] = round(($temp['chengji_cnt'] - $temp['jige']) / $temp['chengji_cnt'] * 100, 2);
}
$data['cj']['all'] = $temp;
diff --git a/app/chengji/model/TongjiBj.php b/app/chengji/model/TongjiBj.php
index 34f24344..3ca1b404 100755
--- a/app/chengji/model/TongjiBj.php
+++ b/app/chengji/model/TongjiBj.php
@@ -56,8 +56,8 @@ class TongjiBj extends BaseModel
$tongjiJg->kaoshi_id = $src['kaoshi_id'];
$tongjiJg->banji_id = $val['id'];
$tongjiJg->subject_id = $cj['id'];
- $tongjiJg->stu_cnt = $cj['stucnt'];
- $tongjiJg->chengji_cnt = $cj['xkcnt'];
+ $tongjiJg->stu_cnt = $cj['stu_cnt'];
+ $tongjiJg->chengji_cnt = $cj['chengji_cnt'];
$tongjiJg->sum = $cj['sum'];
$tongjiJg->avg = $cj['avg'];
$tongjiJg->biaozhuncha = $cj['biaozhuncha'];
@@ -78,8 +78,8 @@ class TongjiBj extends BaseModel
'kaoshi_id' => $src['kaoshi_id']
,'banji_id' => $val['id']
,'subject_id' => $cj['id']
- ,'stu_cnt' => $cj['stucnt']
- ,'chengji_cnt' => $cj['xkcnt']
+ ,'stu_cnt' => $cj['stu_cnt']
+ ,'chengji_cnt' => $cj['chengji_cnt']
,'sum' => $cj['sum']
,'avg' => $cj['avg']
,'biaozhuncha' => $cj['biaozhuncha']
@@ -454,7 +454,7 @@ class TongjiBj extends BaseModel
$query->field('id, title, enddate');
}
])
- ->append(['banjiTitle', 'youxiulv', 'jigelv'])
+ ->append(['banjiTitle', 'youxiulv', 'jigelv', 'chashenglv', 'canshilv'])
->select();
return $data;
diff --git a/app/chengji/model/TongjiNj.php b/app/chengji/model/TongjiNj.php
index c5def968..ad5b625a 100755
--- a/app/chengji/model/TongjiNj.php
+++ b/app/chengji/model/TongjiNj.php
@@ -53,8 +53,8 @@ class TongjiNj extends BaseModel
$tongjiJg->school_id = $school['id'];
$tongjiJg->ruxuenian = $nianji['ruxuenian'];
$tongjiJg->subject_id = $cj['id'];
- $tongjiJg->stu_cnt = $cj['stucnt'];
- $tongjiJg->chengji_cnt = $cj['xkcnt'];
+ $tongjiJg->stu_cnt = $cj['stu_cnt'];
+ $tongjiJg->chengji_cnt = $cj['chengji_cnt'];
$tongjiJg->sum = $cj['sum'];
$tongjiJg->avg = $cj['avg'];
$tongjiJg->biaozhuncha = $cj['biaozhuncha'];
@@ -76,8 +76,8 @@ class TongjiNj extends BaseModel
'school_id' => $school['id'],
'ruxuenian' => $nianji['ruxuenian'],
'subject_id' => $cj['id'],
- 'stu_cnt' => $cj['stucnt'],
- 'chengji_cnt' => $cj['xkcnt'],
+ 'stu_cnt' => $cj['stu_cnt'],
+ 'chengji_cnt' => $cj['chengji_cnt'],
'sum' => $cj['sum'],
'avg' => $cj['avg'],
'biaozhuncha' => $cj['biaozhuncha'],
diff --git a/app/chengji/model/TongjiSch.php b/app/chengji/model/TongjiSch.php
index 2631f229..583880f8 100755
--- a/app/chengji/model/TongjiSch.php
+++ b/app/chengji/model/TongjiSch.php
@@ -43,8 +43,8 @@ class TongjiSch extends BaseModel
$tongjiJg->kaoshi_id = $src['kaoshi_id'];
$tongjiJg->ruxuenian = $nianji['ruxuenian'];
$tongjiJg->subject_id = $cj['id'];
- $tongjiJg->stu_cnt = $cj['stucnt'];
- $tongjiJg->chengji_cnt = $cj['xkcnt'];
+ $tongjiJg->stu_cnt = $cj['stu_cnt'];
+ $tongjiJg->chengji_cnt = $cj['chengji_cnt'];
$tongjiJg->sum = $cj['sum'];
$tongjiJg->avg = $cj['avg'];
$tongjiJg->biaozhuncha = $cj['biaozhuncha'];
@@ -65,8 +65,8 @@ class TongjiSch extends BaseModel
'kaoshi_id' => $src['kaoshi_id']
,'ruxuenian' => $nianji['ruxuenian']
,'subject_id' => $cj['id']
- ,'stu_cnt' => $cj['stucnt']
- ,'chengji_cnt' => $cj['xkcnt']
+ ,'stu_cnt' => $cj['stu_cnt']
+ ,'chengji_cnt' => $cj['chengji_cnt']
,'sum' => $cj['sum']
,'avg' => $cj['avg']
,'biaozhuncha' => $cj['biaozhuncha']
diff --git a/app/chengji/view/index/index.html b/app/chengji/view/index/index.html
index dd234317..45f7c37f 100755
--- a/app/chengji/view/index/index.html
+++ b/app/chengji/view/index/index.html
@@ -85,17 +85,39 @@
{type:'checkbox', fixed: 'left'},
{field: 'school_jiancheng', title: '学校', minWidth:100,sort: true},
// {field: 'nianji', title: '年级 ', minWidth:100,sort: true},
- {field: "ban_title",title: '班级',sort: true},
+ {field: "ban_title",title: '班级', minWidth:120,sort: true},
{field: "student_xingming", title: '学生姓名',sort: true, minWidth:100},
]];
var xk = '';
xk = eval(decodeURIComponent(xk));
- for(x in xk)
- {
- options.cols[0].push({field: xk[x].lieming, title: xk[x].title , minWidth:100,sort: true,edit:'text'});
- }
+ var tjxm = '';
+ tjxm = eval(decodeURIComponent(tjxm));
+
+ $.each(xk,function(index,value){
+ options.cols[0].push({field: value.lieming, title: value.title , minWidth:120,sort: true,edit:'text',templet:function(d){
+ var str = d[value.lieming].defen;
+ if(str == null)
+ {
+ str = '';
+ }
+ return str;
+ }});
+ $.each(tjxm, function(t, val){
+ options.cols[0].push({field: val.biaoshi, title: value.title + val.title , minWidth:120,sort: true,templet:function(d){
+ var str = d[value.lieming][val.biaoshi];
+ if(str == null)
+ {
+ str = '';
+ }
+ return str;
+ }});
+ })
+
+ });
+
+
options.cols[0].push({field: 'avg', title: '平均分', minWidth:100,sort: true});
options.cols[0].push({field: 'sum', title: '总分', minWidth:100,sort: true});
options.cols[0].push({field: 'id', title: '操作',toolbar: '#barDemo',minWidth:125});
diff --git a/app/kaohao/model/SearchMore.php b/app/kaohao/model/SearchMore.php
index 70d972e7..3ff879f3 100755
--- a/app/kaohao/model/SearchMore.php
+++ b/app/kaohao/model/SearchMore.php
@@ -44,7 +44,7 @@ class SearchMore extends BaseModel
})
->with([
'ksChengji' => function($query){
- $query->field('id, kaohao_id, subject_id, defen, bpaixu, xpaixu')
+ $query->field('id, kaohao_id, subject_id, defen, defenlv, bpaixu, xpaixu, qpaixu, bweizhi, xweizhi, qweizhi')
->with([
'subjectName' => function ($q) {
$q->field('id, title, jiancheng, lieming');
@@ -107,23 +107,43 @@ class SearchMore extends BaseModel
$dfsum = 0;
$sbjcnt = 0;
-
if (!$value->ksChengji->isEmpty()) {
$value->ksChengji = self::zzcj($value->ksChengji);
foreach ($xk as $k => $val) {
if(isset($value->ksChengji[$val['lieming']]))
{
- $data[$key][$val['lieming']]=$value->ksChengji[$val['lieming']]->defen * 1;
- $dfsum = $dfsum + $data[$key][$val['lieming']];
+ $data[$key][$val['lieming']]['defen'] = $value->ksChengji[$val['lieming']]->defen * 1;
+ $data[$key][$val['lieming']]['defenlv'] = $value->ksChengji[$val['lieming']]->defenlv * 1;
+ $data[$key][$val['lieming']]['bpaixu'] = $value->ksChengji[$val['lieming']]->bpaixu * 1;
+ $data[$key][$val['lieming']]['bweizhi'] = $value->ksChengji[$val['lieming']]->bweizhi;
+ $data[$key][$val['lieming']]['xpaixu'] = $value->ksChengji[$val['lieming']]->xpaixu * 1;
+ $data[$key][$val['lieming']]['xweizhi'] = $value->ksChengji[$val['lieming']]->xweizhi;
+ $data[$key][$val['lieming']]['qpaixu'] = $value->ksChengji[$val['lieming']]->qpaixu * 1;
+ $data[$key][$val['lieming']]['qweizhi'] = $value->ksChengji[$val['lieming']]->qweizhi;
+ $dfsum = $dfsum + $data[$key][$val['lieming']]['defen'];
$sbjcnt++;
}else{
- $data[$key][$val['lieming']]= null;
+ $data[$key][$val['lieming']] = null;
+ $data[$key][$val['lieming']]['defenlv'] = null;
+ $data[$key][$val['lieming']]['bpaixu'] = null;
+ $data[$key][$val['lieming']]['bweizhi'] = null;
+ $data[$key][$val['lieming']]['xpaixu'] = null;
+ $data[$key][$val['lieming']]['xweizhi'] = null;
+ $data[$key][$val['lieming']]['qpaixu'] = null;
+ $data[$key][$val['lieming']]['qweizhi'] = null;
}
}
}else{
foreach ($xk as $k => $val) {
- $data[$key][$val['lieming']]= null;
+ $data[$key][$val['lieming']]['defen'] = null;
+ $data[$key][$val['lieming']]['defenlv'] = null;
+ $data[$key][$val['lieming']]['bpaixu'] = null;
+ $data[$key][$val['lieming']]['bweizhi'] = null;
+ $data[$key][$val['lieming']]['xpaixu'] = null;
+ $data[$key][$val['lieming']]['xweizhi'] = null;
+ $data[$key][$val['lieming']]['qpaixu'] = null;
+ $data[$key][$val['lieming']]['qweizhi'] = null;
}
}
diff --git a/app/kaoshi/view/kaoshi_set/index.html b/app/kaoshi/view/kaoshi_set/index.html
index 65605d0e..3ea2aa16 100755
--- a/app/kaoshi/view/kaoshi_set/index.html
+++ b/app/kaoshi/view/kaoshi_set/index.html
@@ -39,7 +39,7 @@
批量删除
diff --git a/app/login/view/index/shangma_log.html b/app/login/view/index/shangma_log.html
index 47af1a08..272d6ec0 100755
--- a/app/login/view/index/shangma_log.html
+++ b/app/login/view/index/shangma_log.html
@@ -55,7 +55,7 @@
系统设置中增加统计项目设置、和系统名称设置
修改单位获取和计算优秀率、得分率方法
修改系统默认类别
- 增加网页成绩统计项目显示设置(超级管理员)
+ 增加成绩统计项目显示设置
增加学科优秀和及格人数、差生率、参与率、全科优秀率、全科优秀人数统计
兼容Linux操作系统
增加基础数据
diff --git a/app/login/view/index/weihu.html b/app/login/view/index/weihu.html
index 0e827dd6..28ee86d0 100755
--- a/app/login/view/index/weihu.html
+++ b/app/login/view/index/weihu.html
@@ -12,14 +12,14 @@
系统维护中……
- 从{$list.shijian}开始,大约{$list.shichang}分钟。