From 65f62275a19844dd1d7da6f614e7a2cce01f3e9f Mon Sep 17 00:00:00 2001 From: win10 Date: Wed, 24 Jun 2020 16:12:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E7=A6=BB=E6=95=99=E5=B8=88=E3=80=81?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chengji/controller/Bjtongji.php | 10 +- app/chengji/controller/Index.php | 14 ++- app/chengji/controller/Luru.php | 5 +- app/chengji/controller/Njtongji.php | 11 ++- app/chengji/controller/Tongji.php | 67 +++++++++++++ app/chengji/route/chengji.php | 2 + app/chengji/view/index/deletecjs.html | 77 +-------------- app/chengji/view/luru/malu.html | 13 ++- app/chengji/view/tongji/edit_defenlv.html | 66 +++++++++++++ app/kaohao/controller/Excel.php | 12 +-- app/kaohao/controller/Index.php | 5 +- app/kaohao/model/Kaohao.php | 23 ++++- app/kaohao/model/Search.php | 63 +++++++------ app/kaohao/view/index/create.html | 2 +- app/kaohao/view/index/read.html | 2 +- app/kaoshi/controller/KaoshiSet.php | 1 + app/kaoshi/view/index/more_action.html | 9 +- app/kaoshi/view/kaoshi_set/index.html | 21 +++++ app/listener/KaoshiLuru.php | 11 ++- .../controller/{Student.php => Index.php} | 6 +- app/student/controller/StudentChengji.php | 8 +- app/student/model/StudentChengji.php | 4 +- app/student/route/student.php | 94 +++++++------------ app/student/validate/Student.php | 2 +- .../view/{student => index}/by_list.html | 6 +- .../view/{student => index}/create.html | 0 .../view/{student => index}/create_all.html | 0 .../view/{student => index}/del_list.html | 10 +- .../view/{student => index}/deletes.html | 2 +- .../view/{student => index}/index.html | 18 ++-- app/student/view/{student => index}/read.html | 0 app/student/view/student_chengji/index.html | 2 +- app/system/model/School.php | 2 +- public/static/x-admin2.2/js/cjgl.js | 2 +- view/create.html | 1 - 35 files changed, 346 insertions(+), 225 deletions(-) create mode 100644 app/chengji/view/tongji/edit_defenlv.html rename app/student/controller/{Student.php => Index.php} (99%) rename app/student/view/{student => index}/by_list.html (94%) rename app/student/view/{student => index}/create.html (100%) rename app/student/view/{student => index}/create_all.html (100%) rename app/student/view/{student => index}/del_list.html (90%) rename app/student/view/{student => index}/deletes.html (96%) rename app/student/view/{student => index}/index.html (90%) rename app/student/view/{student => index}/read.html (100%) diff --git a/app/chengji/controller/Bjtongji.php b/app/chengji/controller/Bjtongji.php index e936975f..50053fc1 100644 --- a/app/chengji/controller/Bjtongji.php +++ b/app/chengji/controller/Bjtongji.php @@ -130,7 +130,7 @@ class Bjtongji extends BaseController count($dataAll) > 0 ? $data['all'] = $dataAll[0] : $data; $ks = new \app\kaoshi\model\Kaoshi; # 参考学科 $ksinfo = $ks->where('id', $src['kaoshi_id']) - ->field('id, title, bfdate') + ->field('id, title, bfdate, enddate') ->find(); $ksset = new \app\kaoshi\model\KaoshiSet; $xk = $ksset->srcSubject($src['kaoshi_id'], '', $src['ruxuenian']); @@ -166,6 +166,8 @@ class Bjtongji extends BaseController // 设置表头信息 $sheet->mergeCells('A1:' . $colname[$colcnt] . '1'); $sheet->setCellValue('A1', $tabletitle); + $sheet->mergeCells('A2:' . $colname[$colcnt] . '2'); + $sheet->setCellValue('A2', '考试时间:' . $ksinfo->bfdate . ' ~ '. $ksinfo->enddate); $sheet->mergeCells('A3:A4'); $sheet->setCellValue('A3', '序号'); $sheet->mergeCells('B3:B4'); @@ -220,6 +222,12 @@ class Bjtongji extends BaseController ], ]; $sheet->getStyle('A1:'.$colname[$col].($row-1))->applyFromArray($styleArray); + $styleArrayJZ = [ # 居中 + 'alignment' => [ + 'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT, + ], + ]; + $sheet->getStyle('A2:'.$colname[$col].'2')->applyFromArray($styleArrayJZ); $styleArray = [ # 加边框 'borders' => [ 'allBorders' => [ diff --git a/app/chengji/controller/Index.php b/app/chengji/controller/Index.php index a5d04767..11f7c31e 100644 --- a/app/chengji/controller/Index.php +++ b/app/chengji/controller/Index.php @@ -246,7 +246,7 @@ class Index extends BaseController // 获取考试标题 $ks = new \app\kaoshi\model\Kaoshi; $ks = $ks->where('id', $src['kaoshi_id']) - ->field('id, title, bfdate') + ->field('id, title, bfdate, enddate') ->find(); // 获取考试年级名称 @@ -274,6 +274,8 @@ class Index extends BaseController $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', '姓名'); @@ -327,6 +329,13 @@ class Index extends BaseController ], ]; $sheet->getStyle('A1:'.$colname[$colcnt + 1] . ($i - 1))->applyFromArray($styleArrayJZ); + // 表格格式 + $styleArrayJZ = [ # 居中 + 'alignment' => [ + 'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT, + ], + ]; + $sheet->getStyle('A2:'.$colname[$colcnt + 1] . ($i - 1))->applyFromArray($styleArrayJZ); $styleArrayBK = [ # 加边框 'borders' => [ 'allBorders' => [ @@ -462,7 +471,7 @@ class Index extends BaseController // 获取考试标题 $ks = new \app\kaoshi\model\Kaoshi; $ks = $ks->where('id', $src['kaoshi_id']) - ->field('id, title, bfdate') + ->field('id, title, bfdate, enddate') ->find(); // 获取考试年级名称 @@ -623,5 +632,4 @@ class Index extends BaseController return json($data); } - } diff --git a/app/chengji/controller/Luru.php b/app/chengji/controller/Luru.php index a9e49a7d..7a55281c 100644 --- a/app/chengji/controller/Luru.php +++ b/app/chengji/controller/Luru.php @@ -70,6 +70,7 @@ class Luru extends BaseController // 渲染 return $this->view->fetch(); } + // 保存使用二维码录入的成绩 public function malusave() @@ -196,7 +197,8 @@ class Luru extends BaseController } $cjone->defen = $list['newdefen']; - $cjone->defenlv = $list['newdefen'] / $manfen * 100; + $cjone->defenlv = $list['newdefen'] / $manfen * 100; + $cjone->user_id = session('userid'); $data = $cjone->save(); } else { $data = [ @@ -343,6 +345,7 @@ class Luru extends BaseController $cjone->restore(); $cjone->defen = $defen; $cjone->defenlv = $defen / $manfen * 100; + $cjone->user_id = $user_id; $cjone->save(); } } else { diff --git a/app/chengji/controller/Njtongji.php b/app/chengji/controller/Njtongji.php index c327b63d..4c1fb98d 100644 --- a/app/chengji/controller/Njtongji.php +++ b/app/chengji/controller/Njtongji.php @@ -125,7 +125,7 @@ class Njtongji extends BaseController ob_start(); $ks = new \app\kaoshi\model\Kaoshi; # 获取参考学科 $ksinfo = $ks->where('id', $src['kaoshi_id']) - ->field('id, title, bfdate') + ->field('id, title, bfdate, enddate') ->find(); $ksset = new \app\kaoshi\model\KaoshiSet; $xk = $ksset->srcSubject($src['kaoshi_id'], '', $src['ruxuenian']); @@ -161,6 +161,8 @@ class Njtongji extends BaseController // 设置表头信息 $sheet->mergeCells('A1:' . $colname[$colcnt] . '1'); $sheet->setCellValue('A1', $tabletitle); + $sheet->mergeCells('A2:' . $colname[$colcnt] . '2'); + $sheet->setCellValue('A2', '考试时间:' . $ksinfo->bfdate . ' ~ '. $ksinfo->enddate); $sheet->mergeCells('A3:A4'); $sheet->setCellValue('A3', '序号'); $sheet->mergeCells('B3:B4'); @@ -208,6 +210,13 @@ class Njtongji extends BaseController ], ]; $sheet->getStyle('A1:' . $colname[$col] . ($row - 1))->applyFromArray($styleArray); + // 表格格式 + $styleArrayJZ = [ # 居中 + 'alignment' => [ + 'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT, + ], + ]; + $sheet->getStyle('A2:' . $colname[$col] . '2')->applyFromArray($styleArrayJZ); $styleArray = [ # 加边框 'borders' => [ 'allBorders' => [ diff --git a/app/chengji/controller/Tongji.php b/app/chengji/controller/Tongji.php index 630d1a81..4b82a040 100644 --- a/app/chengji/controller/Tongji.php +++ b/app/chengji/controller/Tongji.php @@ -70,6 +70,73 @@ class Tongji extends BaseController } + // 按学科重新计算得分率 + public function editDefenlv($kaoshi_id) { + + // 设置页面标题 + $list['set'] = array( + 'webtitle'=>'编辑课题', + 'butname'=>'修改', + 'formpost'=>'PUT', + 'url'=>'/chengji/tongji/editdfl', + 'kaoshi_id'=>$kaoshi_id + ); + + // 模板赋值 + $this->view->assign('list', $list); + // 渲染 + return $this->view->fetch(); + } + + + // 更新得分率 + public function updateDefenLv() { + // 获取参数 + $src = $this->request + ->only([ + 'kaoshi_id' => 0 + ,'subject_id' => 0 + ,'nianji' => 0 + ], 'PUT'); + + // 获取满分 + $ksSet = new \app\kaoshi\model\KaoshiSet; + $manfen = $ksSet->where('kaoshi_id', $src['kaoshi_id']) + ->where('subject_id', $src['subject_id']) + ->where('nianji', $src['nianji']) + ->field('id,title') + ->value('manfen'); + // 获取考号 + $kaohao = new \app\kaohao\model\Kaohao; + $kaohaoid = $kaohao->where('kaoshi_id', $src['kaoshi_id']) + ->where('ruxuenian', $src['nianji']) + ->column('id'); + // 查询成绩 + $cj = new \app\chengji\model\Chengji; + $cjList = $cj->where('kaohao_id', 'in', $kaohaoid) + ->where('subject_id', $src['subject_id']) + ->whereNotNull('defen') + ->field('id, defen, defenlv') + ->select(); + + $data = array(); + foreach ($cjList as $key => $value) { + $data[] = [ + 'id' => $value->id + ,'defenlv' => $value->defen / $manfen *100 + ]; + } + + $data = $cj->saveAll($data); + + $data ? $data = ['msg' => '重新计算完成', 'val' => 1] + : $data = ['msg' => '数据处理错误', 'val' => 0]; + + // 返回信息 + return json($data); + } + + public function newJieguo($kaoshi_id) { // 获取考试信息 diff --git a/app/chengji/route/chengji.php b/app/chengji/route/chengji.php index b816549a..8ab22219 100644 --- a/app/chengji/route/chengji.php +++ b/app/chengji/route/chengji.php @@ -32,6 +32,8 @@ Route::group('index', function () { Route::group('tongji', function () { Route::rule('yilucnt/','Tongji/yiluCnt'); # 更新信息 Route::rule('data','Tongji/ajaxData','post'); # 扫码界面 + Route::rule('editdfl/','Tongji/editDefenLv','get'); # 扫码界面 + Route::rule('editdfl','Tongji/updateDefenLv','put'); # 扫码界面 }); diff --git a/app/chengji/view/index/deletecjs.html b/app/chengji/view/index/deletecjs.html index a386bc8b..44bcfcad 100644 --- a/app/chengji/view/index/deletecjs.html +++ b/app/chengji/view/index/deletecjs.html @@ -66,7 +66,7 @@ layui.use(['form','cjgl'], function(){ function addBanji(){ // 获取参数 formval = form.val("myform"); - cjgl.createCheckbox('banji',formval,'/kaoshi/index/cybanji','banjiids','banTitle'); + cjgl.createCheckbox('banji',formval,'/kaoshi/index/cybanji','banji_id','banTitle'); } @@ -74,82 +74,9 @@ layui.use(['form','cjgl'], function(){ function addSubject(){ // 获取参数 formval = form.val("myform"); - cjgl.createCheckbox('subject',formval,'/kaoshi/index/cysubject','subject','title'); + cjgl.createCheckbox('subject',formval,'/kaoshi/index/cysubject','subject_id','title'); } - - - - - - - - - - // // 监听选择按钮 - // form.on('select', function(data){ - // var myselectname = $(data.elem).attr('name'); - // if(myselectname == 'school' || myselectname == 'ruxuenian'){ - // mybanji(); - // } - // }); - - // // 监听班级复选框 - // form.on('checkbox(selectall)', function(data){ - // if(data.elem.checked == true) - // { - // $(data.elem).nextAll('input').each(function() - // { - // $(this).attr('checked',true); - // }); - // }else{ - // $(data.elem).nextAll('input').each(function() - // { - // $(this).attr('checked',false); - // }); - // } - - // form.render('checkbox'); - // }); - - // //获取班级列表并更新 - // function mybanji(){ - // // 获取表单值 - // var school = $('#school').val() - // ,ruxuenian = $('#ruxuenian').val(); - - // // 获取节点 - // var bj = $("#banjidiv"); - - // // 删除原来已有值 - // $(bj).children().remove(); - // // 获取班级列表 - // $.ajax({ - // url:"/kaoshi/index/cybanji", - // type:"POST", - // data:{ - // school:school - // ,ruxuenian:ruxuenian - // ,kaoshi_id:"{$list.set.kaoshi_id}" - // }, - // dataType:'json', - // success:function(result){ - // $(bj).append(''); - // // if(result.length > 0){ - // result.forEach(function(val,index){ - // $(bj).append(''); - // }) - // // } - // form.render('checkbox'); - // }, - // error:function(xhr,status,error) { - // layer.msg('数据处理错误',{ - // icon: 2, - // time: 2000 //2秒关闭(如果不配置,默认是3秒) - // }); - // } - // }); - // } }); {/block} diff --git a/app/chengji/view/luru/malu.html b/app/chengji/view/luru/malu.html index 8a7be972..5f293f80 100644 --- a/app/chengji/view/luru/malu.html +++ b/app/chengji/view/luru/malu.html @@ -59,13 +59,13 @@ $('#xsschool').text(data.cjSchool.jiancheng); $('#xsbanji').text(data.cjBanji.banjiTitle); $('#xsxingming').text(data.cjStudent['xingming']); - $('#xsxueke').text(data.ksChengji[0].subjectName.title); + $('#xsxueke').text(data.subjectName.title); $('#kaohao_id').val(data.id); - $('#subject_id').val(data.ksChengji[0].subjectName.id); + $('#subject_id').val(data.subjectName.id); $('#nianji').val(data.cjBanji.ruxuenian); - if(data.ksChengji[0]){ - $('#defen').val(data.ksChengji[0].defen); + if(data.chengji){ + $('#defen').val(data.chengji.defen); } $('#saoma').val(''); $('#defen').focus(); @@ -116,6 +116,11 @@ } }); + +$("#defen").focus(function(){ + $(this).select(); +}); + {/block} diff --git a/app/chengji/view/tongji/edit_defenlv.html b/app/chengji/view/tongji/edit_defenlv.html new file mode 100644 index 00000000..7cd5756c --- /dev/null +++ b/app/chengji/view/tongji/edit_defenlv.html @@ -0,0 +1,66 @@ +{extend name=".././view/create.html" /} + +{block name="form"} +
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+
+{/block} + +{block name="myjs"} + +{/block} + diff --git a/app/kaohao/controller/Excel.php b/app/kaohao/controller/Excel.php index 16e4c343..1b971dd9 100644 --- a/app/kaohao/controller/Excel.php +++ b/app/kaohao/controller/Excel.php @@ -8,12 +8,11 @@ use app\BaseController; use app\kaoshi\model\Kaoshi as KS; use app\kaohao\model\Search as khSrc; use app\kaoshi\model\KaoshiSet as ksset; +use app\kaohao\model\KaohaoSearch as khSear; use PhpOffice\PhpSpreadsheet\Spreadsheet; use \Endroid\QrCode\QrCode; use think\Validate; -use app\kaohao\model\KaohaoSearch as khSear; - class Excel extends BaseController { @@ -141,14 +140,6 @@ class Excel extends BaseController $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xls'); $writer->save('php://output'); - // 保存文件 - $filename = $kslist->title . ' 标签数据' . date('ymdHis') . '.xlsx'; - header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); - header('Content-Disposition: attachment;filename="' . $filename . '"'); - header('Cache-Control: max-age=0'); - $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx'); - $writer->save('php://output'); - // halt('aa'); ob_flush(); flush(); } @@ -304,7 +295,6 @@ class Excel extends BaseController // 设置筛选 $sheet->setAutoFilter('A3:' . $col . ($i - 1)); - // 保存文件 $filename = $kslist->title . '成绩采集表' . date('ymdHis') . '.xlsx'; header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); diff --git a/app/kaohao/controller/Index.php b/app/kaohao/controller/Index.php index 858c4d31..3f988f96 100644 --- a/app/kaohao/controller/Index.php +++ b/app/kaohao/controller/Index.php @@ -57,7 +57,7 @@ class Index extends BaseController } // 获取参加考试学生名单 - $stu = new \app\renshi\model\Student; + $stu = new \app\student\model\Student; $src = [ 'banji_id' => $list['banji_id'] ,'kaoshi' => 1 @@ -171,6 +171,7 @@ class Index extends BaseController 'kaoshi_id' ,'banji_id' ,'student_id' + ,'school_id' ], 'POST'); $list['student_id'] = explode(' ', $list['student_id']); $list['student_id'] = $list['student_id'][1]; @@ -219,7 +220,7 @@ class Index extends BaseController public function read($id) { $list['webtitle'] ='成绩'; - $list['dataurl'] = '/renshi/studentcj/chengjilist'; + $list['dataurl'] = '/student/studentcj/chengjilist'; $list['id'] = $id; $stucj = new \app\kaohao\model\Search; diff --git a/app/kaohao/model/Kaohao.php b/app/kaohao/model/Kaohao.php index 5283e382..07cab3ea 100644 --- a/app/kaohao/model/Kaohao.php +++ b/app/kaohao/model/Kaohao.php @@ -37,7 +37,12 @@ class Kaohao extends BaseModel }) ->with([ 'ksChengji' => function($query){ - $query->field('id, kaohao_id, subject_id, defen'); + $query->field('id, kaohao_id, subject_id, defen, bweizhi, xweizhi, qweizhi') + ->with([ + 'subjectName' => function ($q) { + $q->field('id, title, jiancheng, lieming'); + } + ]); } ,'cjSchool' => function($query){ $query->field('id, jiancheng'); @@ -49,6 +54,10 @@ class Kaohao extends BaseModel ->append(['banjiTitle', 'banTitle']) ->select(); + foreach ($data as $key => $value) { + $data[$key]->ksChengji = $this->zzcj($value->ksChengji); + } + return $data; } @@ -112,6 +121,18 @@ class Kaohao extends BaseModel return $title; } + + // 转置成绩数组 + private function zzcj($array = array()) + { + $arr = array(); + foreach ($array as $key => $value) { + $array[$value->subjectName->lieming] = $value; + unset($array[$key]); + } + return $array; + } + } diff --git a/app/kaohao/model/Search.php b/app/kaohao/model/Search.php index d557b2b1..dc288363 100644 --- a/app/kaohao/model/Search.php +++ b/app/kaohao/model/Search.php @@ -10,7 +10,7 @@ use \app\kaohao\model\Kaohao as kh; class Search extends BaseModel { - // 查询学生成绩详细信息 + // 查询学生各学科成绩详细信息 public function srcChengjiList($srcfrom) { // 初始化参数 @@ -64,25 +64,26 @@ class Search extends BaseModel $dfsum = 0; $sbjcnt = 0; - // 整理当前学生成绩 - $cjarr = $this->zzcj($value->ksChengji); - - // 初始化参数 - $sbjcnt = 0; #记录拥有成绩的学科数 - - foreach ($xk as $k => $val) { - if(array_key_exists($k,$cjarr)) - { - $data[$key][$val]=$cjarr[$k] * 1; - $sbjcnt++; - }else{ + if (!$value->ksChengji->isEmpty()) { + foreach ($xk as $k => $val) { + if(isset($value->ksChengji[$val])) + { + $data[$key][$val]=$value->ksChengji[$val]->defen * 1; + $dfsum = $dfsum + $data[$key][$val]; + $sbjcnt++; + }else{ + $data[$key][$val]= null; + } + } + }else{ + foreach ($xk as $k => $val) { $data[$key][$val]= null; } } if($sbjcnt>0){ - $data[$key]['sum'] = array_sum($cjarr); - $data[$key]['avg'] = round($data[$key]['sum']/$sbjcnt,1); + $data[$key]['sum'] = $dfsum; + $data[$key]['avg'] = round($dfsum / $sbjcnt, 1); }else{ $data[$key]['sum'] = null; $data[$key]['avg'] = null; @@ -309,16 +310,7 @@ class Search extends BaseModel $stuCj = $kh::where('id', $id) ->field('id ,banji_id, school_id, student_id') ->with([ - 'ksChengji' => function($q) use($subject_id){ - $q->where('subject_id',$subject_id) - ->field('kaohao_id, subject_id, defen') - ->with([ - 'subjectName' => function ($W) { - $W->field('id,title'); - } - ]); - } - ,'cjBanji' => function($q){ + 'cjBanji' => function($q){ $q->field('id, paixu, ruxuenian') ->append(['numTitle', 'banjiTitle']); } @@ -331,7 +323,7 @@ class Search extends BaseModel ]) ->find(); - if($stuCj->cjStudent == Null) + if($stuCj->cjStudent->isEmpty()) { $stu = new \app\student\model\Student; $stuinfo = $stu::withTrashed() @@ -344,6 +336,20 @@ class Search extends BaseModel ); } + $sbj = new \app\teach\model\Subject; + $sbjinfo = $sbj + ->where('id', $subject_id) + ->field('id, title, jiancheng') + ->find(); + $stuCj->subjectName = $sbjinfo; + + $cj = new \app\chengji\model\Chengji; + $cjinfo = $cj->where('kaohao_id', $id) + ->where('subject_id', $subject_id) + ->field('id,subject_id,kaohao_id,defen') + ->find(); + $stuCj->chengji = $cjinfo; + return $stuCj; } @@ -488,9 +494,10 @@ class Search extends BaseModel { $arr = array(); foreach ($array as $key => $value) { - $arr[$value['subject_id']] = $value['defen']; + $array[$value->subjectName->lieming] = $value; + unset($array[$key]); } - return $arr; + return $array; } } diff --git a/app/kaohao/view/index/create.html b/app/kaohao/view/index/create.html index 2ec90fd3..ef474418 100644 --- a/app/kaohao/view/index/create.html +++ b/app/kaohao/view/index/create.html @@ -111,7 +111,7 @@ } // 获取数据 $.post( - "/renshi/student/srcstudent", + "/student/index/srcstudent", { "str":str, "banji_id":banji, diff --git a/app/kaohao/view/index/read.html b/app/kaohao/view/index/read.html index 41289636..cf4b6b60 100644 --- a/app/kaohao/view/index/read.html +++ b/app/kaohao/view/index/read.html @@ -101,7 +101,7 @@ // 条形统计图--平均分 function getLeiDa(kaohao_id){ - var url = '/renshi/studentcj/chengjileida'; + var url = '/student/studentcj/chengjileida'; var title = '学科成绩雷达图'; var val = { kaohao_id: kaohao_id diff --git a/app/kaoshi/controller/KaoshiSet.php b/app/kaoshi/controller/KaoshiSet.php index 82165101..3176bacb 100644 --- a/app/kaoshi/controller/KaoshiSet.php +++ b/app/kaoshi/controller/KaoshiSet.php @@ -287,4 +287,5 @@ class KaoshiSet extends BaseController // 返回信息 return json($data); } + } diff --git a/app/kaoshi/view/index/more_action.html b/app/kaoshi/view/index/more_action.html index c34ef305..8089f146 100644 --- a/app/kaoshi/view/index/more_action.html +++ b/app/kaoshi/view/index/more_action.html @@ -115,6 +115,12 @@
统计学生成绩在全区位置
+ +
+ +
修改分数线后重算得分率
+
+
2、成绩统计
@@ -136,7 +142,6 @@
统计各年级成绩
-
 
@@ -170,7 +175,7 @@ -
+
 
diff --git a/app/kaoshi/view/kaoshi_set/index.html b/app/kaoshi/view/kaoshi_set/index.html index 21b052eb..0ef18b84 100644 --- a/app/kaoshi/view/kaoshi_set/index.html +++ b/app/kaoshi/view/kaoshi_set/index.html @@ -47,6 +47,7 @@ {/block} diff --git a/app/listener/KaoshiLuru.php b/app/listener/KaoshiLuru.php index 0373f923..51f65e49 100644 --- a/app/listener/KaoshiLuru.php +++ b/app/listener/KaoshiLuru.php @@ -20,10 +20,15 @@ class KaoshiLuru { $event = new MyEvent; $ksInfo = $event->ksInfo($kaoshi_id); - if($ksInfo->luru == 0) - { - return $this->error('本次考试已经不允许操作!','/login/err'); + if($ksInfo){ + if($ksInfo->luru == 0) + { + return $this->error('本次考试已经不允许操作!','/login/err'); + } + }else{ + return $this->error('没有找到考试。','/login/err'); } + return $ksInfo; diff --git a/app/student/controller/Student.php b/app/student/controller/Index.php similarity index 99% rename from app/student/controller/Student.php rename to app/student/controller/Index.php index 7b6340db..9b9275dc 100644 --- a/app/student/controller/Student.php +++ b/app/student/controller/Index.php @@ -9,15 +9,15 @@ use app\student\model\Student as STU; // 引用phpspreadsheet类 use app\student\controller\Myexcel; -class Student extends BaseController +class Index extends BaseController { // 显示学生列表 public function index() { // 设置要给模板赋值的信息 $list['webtitle'] = '学生列表'; - $list['dataurl'] = 'student/data'; - $list['status'] = '/reshi/student/status'; + $list['dataurl'] = '/student/index/data'; + $list['status'] = '/student/index/status'; $list['kaoshi'] = '/student/index/kaoshi'; // 模板赋值 diff --git a/app/student/controller/StudentChengji.php b/app/student/controller/StudentChengji.php index 3ffd9967..18e63ea9 100644 --- a/app/student/controller/StudentChengji.php +++ b/app/student/controller/StudentChengji.php @@ -1,14 +1,14 @@ xingming . ' - 成绩'; - $myInfo['dataurl'] = '/renshi/studentcj/data'; + $myInfo['dataurl'] = '/student/studentcj/data'; $myInfo['student_id'] = $id; // 模板赋值 diff --git a/app/student/model/StudentChengji.php b/app/student/model/StudentChengji.php index f1a3d9de..f4454ada 100644 --- a/app/student/model/StudentChengji.php +++ b/app/student/model/StudentChengji.php @@ -1,7 +1,7 @@ find(); // 参加考试学科 - $subject = subjectList(); + $subject = subjectList(1,1); // 获取参加考试学科满分 $ksset = new \app\kaoshi\model\KaoshiSet; $manfen = $ksset->srcSubject($khInfo->kaoshi, '', $khInfo->ruxuenian); diff --git a/app/student/route/student.php b/app/student/route/student.php index ad3ec2d7..54707c8a 100644 --- a/app/student/route/student.php +++ b/app/student/route/student.php @@ -11,68 +11,44 @@ use think\facade\Route; // 学生管理 -Route::group('/', function () { - Route::rule('','Student/index','get'); # 信息列表 - Route::rule('data','Student/ajaxdata','post'); # 获取数据 - Route::rule('create','Student/create','get'); # 添加信息 - Route::rule('save','Student/save','post'); # 保存信息 - Route::rule('edit/','Student/edit','get'); # 修改信息 - Route::rule('update/','Student/update','put'); # 更新信息 - Route::rule('read/','Student/read','get'); # 读取信息 - Route::rule('delete/','Student/delete','delete'); # 删除信息 - Route::rule('status','Student/setStatus','post'); # 删除信息 - Route::rule('createall','Student/createAll','get'); # 批量导入 - Route::rule('saveall','Student/saveAll','post'); # 批量保存 - Route::rule('deletes','Student/deletes','get'); # 批量保存 - Route::rule('deleteall','Student/deleteXlsx','post'); # 批量保存 - Route::rule('download','Student/download','get'); # 批量保存 - Route::rule('srcstudent','Student/srcStudent','post'); # 获取学生成绩 - Route::rule('redel/','Student/reDel','delete'); # 恢复删除的学生 - Route::rule('kaoshi','Student/setKaoshi','post'); # 删除信息 - }); +Route::group('index', function () { + Route::rule('index','Index/index','get'); # 信息列表 + Route::rule('data','Index/ajaxdata','post'); # 获取数据 + Route::rule('create','Index/create','get'); # 添加信息 + Route::rule('save','Index/save','post'); # 保存信息 + Route::rule('edit/','Index/edit','get'); # 修改信息 + Route::rule('update/','Index/update','put'); # 更新信息 + Route::rule('read/','Index/read','get'); # 读取信息 + Route::rule('delete/','Index/delete','delete'); # 删除信息 + Route::rule('status','Index/setStatus','post'); # 删除信息 + Route::rule('createall','Index/createAll','get'); # 批量导入 + Route::rule('saveall','Index/saveAll','post'); # 批量保存 + Route::rule('deletes','Index/deletes','get'); # 批量保存 + Route::rule('deleteall','Index/deleteXlsx','post'); # 批量保存 + Route::rule('download','Index/download','get'); # 批量保存 + Route::rule('srcstudent','Index/srcStudent','post'); # 获取学生成绩 + Route::rule('redel/','Index/reDel','delete'); # 恢复删除的学生 + Route::rule('kaoshi','Index/setKaoshi','post'); # 删除信息 + Route::rule('bylist','Index/byList','get'); # 信息列表 + Route::rule('databy','Index/ajaxdataBy','post'); # 获取数据 + Route::rule('dellist','Index/delList','get'); # 信息列表 + Route::rule('datadel','Index/ajaxdataDel','post'); # 获取数据 +}); // 学生成绩列表 Route::group('studentcj', function () { - Route::rule('','StudentChengji/index','get'); # 读取信息 - Route::rule('data','StudentChengji/ajaxData','post'); # 获取学生成绩列表 - Route::rule('chengjitubiao','StudentChengji/ajaxOneStudentChengjiTuBiao','post'); # 获取学生成绩列表 - Route::rule('chengjileida','StudentChengji/ajaxOneStudentChengjiLeiDa','post'); # 获取学生成绩列表 - }); + Route::rule('','StudentChengji/index','get'); # 读取信息 + Route::rule('data','StudentChengji/ajaxData','post'); # 获取学生成绩列表 + Route::rule('chengjitubiao','StudentChengji/ajaxOneStudentChengjiTuBiao','post'); # 获取学生成绩列表 + Route::rule('chengjileida','StudentChengji/ajaxOneStudentChengjiLeiDa','post'); # 获取学生成绩列表 +}); -// 学生管理 -Route::group('student', function () { - Route::rule('bylist','Student/byList','get'); # 信息列表 - Route::rule('databy','Student/ajaxdataBy','post'); # 获取数据 - Route::rule('dellist','Student/delList','get'); # 信息列表 - Route::rule('datadel','Student/ajaxdataDel','post'); # 获取数据 - }); - - -// 教师管理 -Route::group('teacher', function () { - Route::rule('','Teacher/index','get'); # 信息列表 - Route::rule('data','Teacher/ajaxdata','post'); # 获取数据 - Route::rule('create','Teacher/create','get'); # 添加信息 - Route::rule('save','Teacher/save','post'); # 保存信息 - Route::rule('read/','Teacher/read','get'); # 读取信息 - Route::rule('edit/','Teacher/edit','get'); # 修改信息 - Route::rule('update/','Teacher/update','put'); # 更新信息 - Route::rule('delete/','Teacher/delete','delete'); # 删除信息 - Route::rule('status','Teacher/setStatus','post'); # 删除信息 - Route::rule('createall','Teacher/createAll','get'); # 批量导入 - Route::rule('saveall','Teacher/saveAll','post'); # 批量保存 - Route::rule('upload','Teacher/upload','post'); # 批量导入 - Route::rule('srcteacher','Teacher/srcTeacher','post'); # 查询教师 - Route::rule('downloadxls','Teacher/downloadXls','get'); # 下载模板 - Route::rule('srcry','Teacher/srcRy','post'); # 查询荣誉 - Route::rule('srckt','Teacher/srcKt','post'); # 查询课题 - }); - -// 教师管理 -Route::group('teacher', function () { - Route::rule('dellist','Teacher/delList','get'); # 信息列表 - Route::rule('datadel','Teacher/ajaxDataDel','post'); # 获取数据 - Route::rule('redel/','Teacher/reDel','delete'); # 获取学生成绩 - }); +// // 学生管理 +// Route::group('student', function () { +// Route::rule('bylist','Student/byList','get'); # 信息列表 +// Route::rule('databy','Student/ajaxdataBy','post'); # 获取数据 +// Route::rule('dellist','Student/delList','get'); # 信息列表 +// Route::rule('datadel','Student/ajaxdataDel','post'); # 获取数据 +// }); \ No newline at end of file diff --git a/app/student/validate/Student.php b/app/student/validate/Student.php index 80eca073..49662c85 100644 --- a/app/student/validate/Student.php +++ b/app/student/validate/Student.php @@ -1,6 +1,6 @@ {php} $schoollist = schoolList('校级', '校级');{/php} {volist name="schoollist" id="vo"} - + {/volist} @@ -99,7 +99,7 @@ layer.msg('这个~算了吧!'); break; var checkStatus = table.checkStatus('mytable'); //idmytable 即为基础参数 id 对应的值 - cjgl.delAll(checkStatus,'/renshi/student/delete','mytable'); + cjgl.delAll(checkStatus,'/student/index/delete','mytable'); break; }; }); @@ -111,13 +111,13 @@ var tr = obj.tr; //获得当前行 tr 的DOM对象 switch(layEvent){ case 'detail':// 查看 - cjgl.add(obj.data.xingming+'信息','/renshi/student/read/'+obj.data.id,'','',true); + cjgl.add(obj.data.xingming+'信息','/student/index/read/'+obj.data.id,'','',true); break; case 'chengji':// 查看 - cjgl.add(obj.data.xingming+'成绩','/renshi/studentcj/'+obj.data.id,'','',true); + cjgl.add(obj.data.xingming+'成绩','/student/studentcj/'+obj.data.id,'','',true); break; case 'huifu':// 恢复删除 - cjgl.redel(obj,"/renshi/student/redel"); + cjgl.redel(obj,"/student/index/redel"); break; }; }); diff --git a/app/student/view/student/deletes.html b/app/student/view/index/deletes.html similarity index 96% rename from app/student/view/student/deletes.html rename to app/student/view/index/deletes.html index df11d0b7..1dbde009 100644 --- a/app/student/view/student/deletes.html +++ b/app/student/view/index/deletes.html @@ -32,7 +32,7 @@ layui.use('upload', function(){ //执行实例 var uploadInst = upload.render({ elem: '#upload' //绑定元素 - ,url: "/renshi/teacher/upload" //上传接口 + ,url: "/teacher/index/upload" //上传接口 ,done: function(res){ if(res.val == 1){ $('#url').val(res.url); diff --git a/app/student/view/student/index.html b/app/student/view/index/index.html similarity index 90% rename from app/student/view/student/index.html rename to app/student/view/index/index.html index de3995ef..209c3dee 100644 --- a/app/student/view/student/index.html +++ b/app/student/view/index/index.html @@ -116,19 +116,19 @@ switch(obj.event){ case 'dels': var checkStatus = table.checkStatus('mytable'); //idmytable 即为基础参数 id 对应的值 - cjgl.delAll(checkStatus,'student/delete','mytable'); + cjgl.delAll(checkStatus,'/student/index/delete','mytable'); break; case 'add': - cjgl.add('添加学生','student/create','','',true); + cjgl.add('添加学生','/student/index/create','','',true); break; case 'upload': - cjgl.add('校对导入','student/createall','','',true); + cjgl.add('校对导入','/student/index/createall','','',true); break; case 'download': - window.open("/renshi/student/download"); + window.open("/student/index/download"); break; case 'jdsc': - cjgl.add('表格删除','student/deletes'); + cjgl.add('表格删除','/student/index/deletes'); break; }; }); @@ -140,16 +140,16 @@ var tr = obj.tr; //获得当前行 tr 的DOM对象 switch(layEvent){ case 'detail':// 查看 - cjgl.add(obj.data.xingming+'-信息','student/read/'+obj.data.id,'','',true); + cjgl.add(obj.data.xingming+'-信息','/student/index/read/'+obj.data.id,'','',true); break; case 'chengji':// 查看 - parent.xadmin.add_tab(obj.data.xingming + ' - 成绩','/renshi/studentcj/'+obj.data.id,true); + parent.xadmin.add_tab(obj.data.xingming + ' - 成绩','/student/studentcj/'+obj.data.id,true); break; case 'del':// 删除 - cjgl.del(obj,"student/delete"); + cjgl.del(obj,"/student/index/delete"); break; case 'edit':// 编辑 - cjgl.add('编辑学生','student/edit/'+obj.data.id,'','',true); + cjgl.add('编辑学生','/student/index/edit/'+obj.data.id,'','',true); break; case 'status':// 状态 cjgl.status(obj,"{:url('setstatus')}"); diff --git a/app/student/view/student/read.html b/app/student/view/index/read.html similarity index 100% rename from app/student/view/student/read.html rename to app/student/view/index/read.html diff --git a/app/student/view/student_chengji/index.html b/app/student/view/student_chengji/index.html index 1c4e56c1..a483e0d4 100644 --- a/app/student/view/student_chengji/index.html +++ b/app/student/view/student_chengji/index.html @@ -211,7 +211,7 @@ // 条形统计图--平均分 function getDefenlv(sbjid, sbjlieming, sbjtitle){ var id = sbjlieming; - var url = '/renshi/studentcj/chengjitubiao'; + var url = '/student/studentcj/chengjitubiao'; var val = form.val('search'); val.subject_id = sbjid; var title = sbjtitle; diff --git a/app/system/model/School.php b/app/system/model/School.php index f16a7e3a..978ad753 100644 --- a/app/system/model/School.php +++ b/app/system/model/School.php @@ -10,7 +10,7 @@ class School extends BaseModel // 教师数据模型关联 public function dwTeacher() { - return $this->hasMany('\app\renshi\model\Teacher', 'danwei_id', 'id'); + return $this->hasMany('\app\teacher\model\Teacher', 'danwei_id', 'id'); } // 单位性质数据模型关联 diff --git a/public/static/x-admin2.2/js/cjgl.js b/public/static/x-admin2.2/js/cjgl.js index 38f7ef8d..1efe6d56 100644 --- a/public/static/x-admin2.2/js/cjgl.js +++ b/public/static/x-admin2.2/js/cjgl.js @@ -299,7 +299,7 @@ layui.define(['table'],function(exports){ //提示:模块也可以依赖其它 cnt = data.count; mydata = data.data; if(cnt>0){ - $('#' + id).append(''); + $('#' + id).append(''); } for(x in mydata){ if(mydata[x][cloval] == checkval) diff --git a/view/create.html b/view/create.html index cbd8f9da..dcbc4ffd 100644 --- a/view/create.html +++ b/view/create.html @@ -50,7 +50,6 @@ //监听提交 form.on('submit(mysubmit)', function(data){ - console.log(data.field) $.ajax({ url:"{$list.set.url}", type:"{$list.set.formpost}",