From ae8073b046e9699287d42fec5a85f5853d0c844b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E6=8E=8C?= Date: Thu, 19 Mar 2020 12:30:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=8F=AD=E7=BA=A7=E5=8E=86?= =?UTF-8?q?=E6=AC=A1=E6=88=90=E7=BB=A9=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chengji/common.php | 32 +- app/chengji/model/Chengji.php | 2 +- app/chengji/model/Tongji.php | 24 +- app/chengji/model/TongjiBj.php | 77 ++++- app/kaoshi/controller/Kaohao.php | 2 - app/login/view/index/shangma_log.html | 4 +- app/middleware/Auth.php | 1 + app/renshi/controller/StudentChengji.php | 6 +- app/renshi/view/student_chengji/index.html | 8 +- app/teach/controller/Banji.php | 21 +- app/teach/controller/BanjiChengji.php | 113 +++++++ app/teach/model/BanjiChengji.php | 101 ++++++ app/teach/model/Subject.php | 12 +- app/teach/route/teach.php | 10 +- app/teach/view/banji/index.html | 128 ++++---- app/teach/view/banji_chengji/index.html | 290 ++++++++++++++++++ .../migrations/20200106012240_tongji_nj.php | 1 + .../migrations/20200106013922_tongji_bj.php | 1 + .../migrations/20200107045207_tongji_sch.php | 1 + database/seeds/Rule.php | 1 + 20 files changed, 713 insertions(+), 122 deletions(-) create mode 100644 app/teach/controller/BanjiChengji.php create mode 100644 app/teach/model/BanjiChengji.php create mode 100644 app/teach/view/banji_chengji/index.html diff --git a/app/chengji/common.php b/app/chengji/common.php index d4b4c7b1..2d54210f 100644 --- a/app/chengji/common.php +++ b/app/chengji/common.php @@ -46,14 +46,14 @@ function manfenvalidate($defen,$manfen) - /** + /** * 从统计结果中获取条形统计图中需要的各项目成绩 - * - * @access public + * + * @access public * @param arr 统计结果 * @param xm 要统计的项目 * @return array 返回类型 - */ + */ function tiaoxingOnexiangmu($jg,$xm) { $chengji = array(); @@ -88,17 +88,17 @@ function manfenvalidate($defen,$manfen) } - /** + /** * 从统计结果中获取条形箱体图需要的各项目成绩 - * - * @access public + * + * @access public * @param arr 统计结果 * @param xm 要统计的项目 * @return array 返回类型 - */ + */ function xiangti($jg) { - + $data = array(); $axisData = array(); $chengji = array(); @@ -113,12 +113,6 @@ function manfenvalidate($defen,$manfen) } foreach ($value['chengji'] as $k => $val) { - // $chengji[$k][$key]['min'] = $val['sifenwei']['min']; - // $chengji[$k][$key]['q1'] = $val['sifenwei']['q1']; - // $chengji[$k][$key]['q2'] = $val['sifenwei']['q2']; - // $chengji[$k][$key]['q3'] = $val['sifenwei']['q3']; - // $chengji[$k][$key]['max'] = $val['sifenwei']['max']; - $chengji[$k][$key][0] = $val['sifenwei']['min']; $chengji[$k][$key][1] = $val['sifenwei']['q1']; $chengji[$k][$key][2] = $val['sifenwei']['q2']; @@ -146,12 +140,12 @@ function manfenvalidate($defen,$manfen) return $data; } - /** + /** * 把给定的成绩进行排序 - * @access public + * @access public * @param array $arr 要计算的一维数组成绩 * @return array $result 返回成绩排序结果 - */ + */ function tjOrder($cj,$type = 'desc') { if($type == 'desc') @@ -162,4 +156,4 @@ function manfenvalidate($defen,$manfen) } return $cj; - } \ No newline at end of file + } diff --git a/app/chengji/model/Chengji.php b/app/chengji/model/Chengji.php index 85fa2f51..2fdb1541 100644 --- a/app/chengji/model/Chengji.php +++ b/app/chengji/model/Chengji.php @@ -194,7 +194,7 @@ class Chengji extends Base { $data[$key][$col[0]] = $data[$key-1][$col[0]]; } - $data[$key][$col[1]] = ($data[$key][$col[0]]-1)/$cnt; + $data[$key][$col[1]] = 1 - ($data[$key][$col[0]]-1)/$cnt; $data[$key][$col[1]] = round($data[$key][$col[1]] * 100 , 2) ; } diff --git a/app/chengji/model/Tongji.php b/app/chengji/model/Tongji.php index ec682ee4..afee7c25 100644 --- a/app/chengji/model/Tongji.php +++ b/app/chengji/model/Tongji.php @@ -10,7 +10,7 @@ class Tongji extends Base // 统计成绩 public function tongjiCnt($cj=array(),$subject) - { + { $data = array(); // 循环统计各学科成绩 @@ -26,7 +26,7 @@ class Tongji extends Base } $data['stucnt'] = count($cj); - + return $data; } @@ -35,8 +35,8 @@ class Tongji extends Base // 统计成绩 public function tongjiSubject($cj=array(),$subject) - { - + { + // 设置默认值 $tempNull = [ 'xkcnt'=>0, @@ -66,7 +66,7 @@ class Tongji extends Base $cjcol = array_column($cj,$value['lieming']); $stucnt = count($cjcol); $cjcol = array_filter($cjcol,function($item){ - return $item !== null; + return $item !== null; }); $temp = $tempNull; @@ -100,7 +100,7 @@ class Tongji extends Base $cjcol = array_column($cj,'sum'); $stucnt = count($cjcol); $cjcol = array_filter($cjcol,function($item){ - return $item !== null; + return $item !== null; }); $temp['id'] = 0; $temp['stucnt'] = $stucnt; @@ -207,12 +207,12 @@ class Tongji extends Base } - /** + /** * 计算四分位( Quartile ) Q1、Q2、Q3的值 - * @access public + * @access public * @param array $arr 要计算的一维数组 * @return array $result 下标0-2 分别对应Q1、Q2、Q3 - */ + */ public function myquartile($arr) { // 获取数组长度 @@ -221,7 +221,7 @@ class Tongji extends Base // 如果数组为空或数组长度小于5时,返回空。 if ($arr == null || $length == 0) return $result = [0=>'',1=>'',2=>'']; if ($length < 5) return $result = [0=>'',1=>'',2=>'']; - + // 数组排序 sort($arr); @@ -246,7 +246,7 @@ class Tongji extends Base { $result[$key] = $arr[$value-1]; }else{ - # 如果位置不是整数。计算公式:大数*位置小数 + 小数*(1-位置小数) + # 如果位置不是整数。计算公式:大数*位置小数 + 小数*(1-位置小数) $tempNum = $value; $temp = intval($tempNum); $tempNum = $tempNum - $temp; @@ -257,5 +257,5 @@ class Tongji extends Base return $result; } - + } diff --git a/app/chengji/model/TongjiBj.php b/app/chengji/model/TongjiBj.php index 71a9a8a5..cc8d6f96 100644 --- a/app/chengji/model/TongjiBj.php +++ b/app/chengji/model/TongjiBj.php @@ -284,6 +284,73 @@ class TongjiBj extends Base } + /** + * 查询班级历次成绩 + */ + public function srcBanjiChengji($srcfrom) + { + // 初始化参数 + $src = array( + 'banji' => '', + 'category' => '', + 'xueqi' => '', + ); + + // 用新值替换初始值 + $src = array_cover( $srcfrom , $src ) ; + $src['xueqi'] = strToarray($src['xueqi']); + $src['category'] = strToarray($src['category']); + + if(isset($srcfrom['bfdate']) && strlen($srcfrom['bfdate'])>0) + { + $src['bfdate'] = $srcfrom['bfdate']; + }else{ + $src['bfdate'] = date("Y-m-d",strtotime("-1 year")); + } + + if(isset($srcfrom['enddate']) && strlen($srcfrom['enddate'])>0) + { + $src['enddate'] = $srcfrom['enddate']; + }else{ + $src['enddate'] = date("Y-m-d",strtotime("+1 day")); + } + + + $data = $this + ->where('banji_id',$src['banji']) + ->where('kaoshi_id','in',function($query) use($src){ + $query->name('kaoshi') + ->whereTime('bfdate|enddate','between',[ $src['bfdate'],$src['enddate'] ]) + ->when(count($src['xueqi']) > 0, function($q) use($src){ + $q->where('xueqi', 'in', function($w) use($src){ + $w->name('xueqi') + ->where('category', 'in', $src['xueqi']) + ->field('id'); + }); + }) + ->when(count($src['category']) > 0, function($q) use($src){ + $q->where('category', 'in', $src['category']); + }) + ->field('id'); + }) + ->with([ + 'bjKaoshi' => function($query){ + $query->field('id,title,bfdate'); + }, + 'bjSubject' => function($query){ + $query->field('id,title,jiancheng,paixu,lieming'); + }, + 'quJieguo' => function($query){ + $query->field('id,kaoshi_id,subject_id,defenlv'); + } + ]) + ->select(); + + return $data; + } + + + // 成绩排序 public function bjOrder($kaoshi) { @@ -353,6 +420,15 @@ class TongjiBj extends Base } + // 区成绩统计结果关联 + public function quJieguo() + { + $sbjid = $this->getAttr('subject_id'); + return $this->belongsTo('\app\chengji\model\TongjiSch','kaoshi_id','kaoshi_id') + ->where('subject_id',$sbjid); + } + + // 获取班级名称 public function getBanjiTitleAttr() { @@ -367,5 +443,4 @@ class TongjiBj extends Base } - } diff --git a/app/kaoshi/controller/Kaohao.php b/app/kaoshi/controller/Kaohao.php index ef5b2a69..6e7ceed6 100644 --- a/app/kaoshi/controller/Kaohao.php +++ b/app/kaoshi/controller/Kaohao.php @@ -40,8 +40,6 @@ class Kaohao extends BaseController 'kaoshi'=>$kaoshi ); - - // 模板赋值 $this->view->assign('list',$list); // 渲染 diff --git a/app/login/view/index/shangma_log.html b/app/login/view/index/shangma_log.html index 3f0a150f..7bb58338 100644 --- a/app/login/view/index/shangma_log.html +++ b/app/login/view/index/shangma_log.html @@ -51,9 +51,11 @@

增加表格操作是否参加考试状态,增加相对应的权限。
- 修复考号生成错误 + 修复考号生成错误、考试成绩查看错误
env配置文件中增加session设置 +
+ 增加班级历次成绩查看

diff --git a/app/middleware/Auth.php b/app/middleware/Auth.php index b6dd2862..adfbdd11 100644 --- a/app/middleware/Auth.php +++ b/app/middleware/Auth.php @@ -60,6 +60,7 @@ class Auth // Teach应用 'teach/banji/mybanji', # 获取班级数据 'teach/banji/banjilist', # 获取班级数据 + 'teach/banjichengji/ajaxdatatiaoxing', # 获取班级成绩-条形统计表 // Kaoshi应用 'kaoshi/index/cyschool', # 获取参加考试学校 'kaoshi/index/cynianji', # 获取参加考试年级 diff --git a/app/renshi/controller/StudentChengji.php b/app/renshi/controller/StudentChengji.php index fc8c5d16..7fabf322 100644 --- a/app/renshi/controller/StudentChengji.php +++ b/app/renshi/controller/StudentChengji.php @@ -35,11 +35,7 @@ class StudentChengji extends BaseController // 获取参加考试学科 $sbj = new \app\teach\model\Subject; - $ksSbj = $sbj - ->where('kaoshi',1) - ->field('id,title,jiancheng,lieming') - ->select() - ->toArray(); + $ksSbj = $sbj->searchKaoshi()->toArray(); $myInfo['sbj'] = $ksSbj; // 设置页面标题 diff --git a/app/renshi/view/student_chengji/index.html b/app/renshi/view/student_chengji/index.html index a02d028c..5d0158c2 100644 --- a/app/renshi/view/student_chengji/index.html +++ b/app/renshi/view/student_chengji/index.html @@ -46,10 +46,10 @@ *考试时间
- +
- +
@@ -83,8 +83,8 @@ // 设置列 options.cols=[[ //表头 {field:'id',type:'numbers',sort:true,width:50,title:'序号'} - ,{field: 'id', title: '操作',toolbar: '#barDemo',minWidth:25} - ,{field: 'category',sort:true, title: '考试类型', minWidth:100} + ,{field: 'id', title: '操作',toolbar: '#barDemo',minWidth:10} + ,{field: 'kaoshiTitle',sort:true, title: '考试类型', minWidth:100} ,{field:'bfdate',title: '考试时间',sort:true, minWidth:150,templet:function(d){ var date; date = d.enddate.split('-'); diff --git a/app/teach/controller/Banji.php b/app/teach/controller/Banji.php index 6a1591e0..40b6f642 100644 --- a/app/teach/controller/Banji.php +++ b/app/teach/controller/Banji.php @@ -51,7 +51,7 @@ class Banji extends BaseController $limit_start = $src['page'] * $src['limit'] - $src['limit']; $limit_length = $src['limit']; $data = $data->slice($limit_start,$limit_length); - + // 重组返回内容 $data = [ 'code'=> 0 , // ajax请求次数,作为标识符 @@ -82,7 +82,7 @@ class Banji extends BaseController return $this->view->fetch('create'); } - + // 保存信息 public function save() @@ -127,7 +127,7 @@ class Banji extends BaseController // 实例化班级数据模型类 $bj = new BJ(); - // 保存数据 + // 保存数据 $data = $bj->saveAll($bjarr); // 根据更新结果设置返回提示信息 @@ -137,14 +137,6 @@ class Banji extends BaseController return json($data); } - // - public function read($id) - { - // - } - - - // 修改班级信息 public function edit($id) @@ -154,7 +146,6 @@ class Banji extends BaseController $list = BJ::field('id,school,ruxuenian,paixu') ->find($id); - $this->view->assign('list',$list); return $this->view->fetch(); @@ -194,7 +185,7 @@ class Banji extends BaseController return json($data); } - + @@ -287,7 +278,7 @@ class Banji extends BaseController $bj = new BJ; $bjtitle = $bj->myBanjiTitle($bjinfo[0]['id']); - + $yz==0 ? $data = ['msg'=>'移动成功','val'=>1,'title'=>$bjtitle,'paixu'=>$bjinfo[0]['paixu']] : $data = ['msg'=>'数据处理错误','val'=>0]; }else{ @@ -296,7 +287,7 @@ class Banji extends BaseController // 返回处理结果 return json($data); - + } diff --git a/app/teach/controller/BanjiChengji.php b/app/teach/controller/BanjiChengji.php new file mode 100644 index 00000000..d9d3f577 --- /dev/null +++ b/app/teach/controller/BanjiChengji.php @@ -0,0 +1,113 @@ +searchKaoshi()->toArray(); + + // 模板赋值 + $this->view->assign('list',$list); + + // 渲染模板 + return $this->view->fetch(); + } + + + // 获取班级成绩数组 + public function ajaxData() + { + // 获取参数 + $src = $this->request + ->only([ + 'page'=>'1', + 'limit'=>'10', + 'field'=>'ks_id', + 'order'=>'desc', + 'banji'=>'', + 'category'=>'', + 'xueqi'=>'', + 'bfdate'=>'', + 'enddate'=>'', + ],'POST'); + + + // 实例化班级成绩数据模型 + $bjcj = new \app\chengji\model\TongjiBj; + $data = $bjcj->srcBanjiChengji($src); + $bjcj = new bjcj; + $data = $bjcj->banjiChengjiList($data); + + + // 获取符合条件记录总数 + $cnt = count($data); + + $src['order'] == 'desc' ? $src['order'] =SORT_DESC :$src['order'] = SORT_ASC; + if($cnt > 0){ + $data = sortArrByManyField($data,$src['field'],$src['order']); + } + + // 获取当前页数据 + $limit_start = $src['page'] * $src['limit'] - $src['limit']; + $limit_length = $src['limit']; + $data = array_slice($data,$limit_start,$limit_length); + + // 重组返回内容 + $data = [ + 'code'=> 0 , // ajax请求次数,作为标识符 + 'msg'=>"", // 获取到的结果数(每页显示数量) + 'count'=>$cnt, // 符合条件的总数据量 + 'data'=>$data, //获取到的数据结果 + ]; + + return json($data); + } + + + // 获取条形统计图数据 + public function ajaxDataTiaoXing() + { + // 获取参数 + $src = $this->request + ->only([ + 'field'=>'ks_id', + 'order'=>'desc', + 'banji'=>'', + 'subject' => '', + 'category'=>'', + 'xueqi'=>'', + 'bfdate'=>'', + 'enddate'=>'', + ],'POST'); + + + // 实例化班级成绩数据模型 + $bjcj = new \app\chengji\model\TongjiBj; + $data = $bjcj->srcBanjiChengji($src); + $bjcj = new bjcj; + $data = $bjcj->tiaoXing($data, $src['subject']); + + return json($data); + + } + +} diff --git a/app/teach/model/BanjiChengji.php b/app/teach/model/BanjiChengji.php new file mode 100644 index 00000000..97659eec --- /dev/null +++ b/app/teach/model/BanjiChengji.php @@ -0,0 +1,101 @@ + $value) { + + if(!isset($data[$value->kaoshi_id])) + { + $data[$value->kaoshi_id] = [ + 'ks_title' => $value->bjKaoshi->title, + 'stu_cnt' => $value->stu_cnt, + 'ks_id' => $value->kaoshi_id, + ]; + } + + if($value->subject_id == 0) + { + $data[$value->kaoshi_id]['quanke'] = [ + 'avg' => $value->avg, + 'jige' => $value->jige, + ]; + }else{ + $data[$value->kaoshi_id]['chengji'][$value->bjSubject->lieming] = [ + 'cj_cnt' => $value->chengji_cnt, + 'avg' => $value->avg, + 'defenlv' => $value->defenlv, + 'youxiu' => $value->youxiu, + 'jige' => $value->jige, + 'biaozhuncha' => $value->biaozhuncha, + 'sifenwei' => [ + 'min' => $value->min, + 'q1' => $value->q1, + 'q2' => $value->q2, + 'q3' => $value->mq3, + 'max' => $value->max, + ], + ]; + } + } + + return $data; + } + + + + + // 本班级、X学科历次得分率。 + public function tiaoXing($cjlist,$subject){ + + // 整理数据 + $data = array(); + $xAxis = array(); + $series = [ + 0 => [ + 'name'=>'班级得分率%', + 'type'=>'line', + 'data'=>array(), + ], + 1 => [ + 'name'=>'全部得分率%', + 'type'=>'line', + 'data'=>array(), + ], + ]; + + + foreach ($cjlist as $key => $value) { + + if($subject == $value->subject_id){ + $xAxis[] = $value->bjKaoshi->title; + $series['0']['data'][] = $value->defenlv; + $series['1']['data'][] = $value->quJieguo->defenlv; + } + } + + $data = [ + 'xAxis' => $xAxis, + 'series' => $series, + 'legend' => ['班级得分率%','全部得分率%'], + ]; + + return $data; + } + + +} diff --git a/app/teach/model/Subject.php b/app/teach/model/Subject.php index 27875cd9..ef051b21 100644 --- a/app/teach/model/Subject.php +++ b/app/teach/model/Subject.php @@ -6,7 +6,7 @@ use app\common\model\Base; class Subject extends Base { - // 查询所有单位 + // 按条件查询学科 public function search($src) { // 整理变量 @@ -27,6 +27,16 @@ class Subject extends Base return $data; } + // 获取参加考试的学科 + public function searchKaoshi() + { + $data = self::where('kaoshi',1) + ->field('id,title,jiancheng,lieming') + ->select(); + + return $data; + } + // 大类别关联 public function sbjCategory() { diff --git a/app/teach/route/teach.php b/app/teach/route/teach.php index e1ec2da4..1f89f7c6 100644 --- a/app/teach/route/teach.php +++ b/app/teach/route/teach.php @@ -30,7 +30,7 @@ Route::group('banji', function () { Route::rule('data','banji/ajaxdata','post'); # 获取数据 Route::rule('create','banji/create','get'); # 添加信息 Route::rule('save','banji/save','post'); # 保存信息 - // Route::rule('read/','banji/read','get'); # 读取信息 + Route::rule('read/','banji/read','get'); # 读取信息 Route::rule('edit/','banji/edit','get'); # 修改信息 Route::rule('update/','banji/update','put'); # 更新信息 Route::rule('delete/','banji/delete','delete'); # 删除信息 @@ -41,6 +41,14 @@ Route::group('banji', function () { }); +// 班级管理 +Route::group('banjicj', function () { + Route::rule('index/','BanjiChengji/index','get'); # 信息列表 + Route::rule('data','BanjiChengji/ajaxData','post'); # 获取成绩 + Route::rule('datatx','BanjiChengji/ajaxDataTiaoXing','post'); # 获取成绩 + }); + + // 学科管理 Route::group('subject', function () { Route::rule('','subject/index','get'); # 信息列表 diff --git a/app/teach/view/banji/index.html b/app/teach/view/banji/index.html index c9372325..4218be76 100644 --- a/app/teach/view/banji/index.html +++ b/app/teach/view/banji/index.html @@ -4,39 +4,39 @@ {/block} {block name="nav"} - - 教务管理 - 班级管理 - 班级列表 - + + 教务管理 + 班级管理 + 班级列表 + {/block} {block name="search"} -
- -
- {php} - $schoollist = schlist('校级','校级',$xueduan=['小学','中小学']); - {/php} - - {volist name="schoollist" id="vo"} - - {/volist} -
+
+ +
+ {php} + $schoollist = schlist('校级','校级',$xueduan=['小学','中小学']); + {/php} + + {volist name="schoollist" id="vo"} + + {/volist}
-
- -
- {foreach :nianjiList() as $key=>$vo } - - {/foreach} -
+
+
+ +
+ {foreach :nianjiList() as $key=>$vo } + + {/foreach}
+
{/block} {block name="table"} -
+
{/block} {block name="myjs"} - + -{/block} \ No newline at end of file +{/block} diff --git a/app/teach/view/banji_chengji/index.html b/app/teach/view/banji_chengji/index.html new file mode 100644 index 00000000..150ecec1 --- /dev/null +++ b/app/teach/view/banji_chengji/index.html @@ -0,0 +1,290 @@ + +{extend name=".././view/list.html" /} +{block name="jsset"} +{load href="__STATIC__/echarts/echarts.js" /} +{/block} +{block name="nav"} + + 教务管理 + 班级管理 + {$list['webtitle']} + +{/block} +{block name="search"} +
+ +
+ +
+
+
+ +
+ + {php} $category = getCategory('学期');{/php} + {volist name="category" id="vo"} + + {/volist} +
+
+
+ +
+ {php} $category = getCategory('考试');{/php} + {volist name="category" id="vo"} + + {/volist} +
+
+
+
+ +
+ +
+
+ +
+
+
+ +{/block} +{block name="table"} +
+{/block} + +{block name="echart"} +{volist name="$list.subject" id="vo"} +
+{/volist} +{/block} +{block name="myjs"} + + + + + + + {/block} diff --git a/database/migrations/20200106012240_tongji_nj.php b/database/migrations/20200106012240_tongji_nj.php index 2cc850c7..aef910d3 100644 --- a/database/migrations/20200106012240_tongji_nj.php +++ b/database/migrations/20200106012240_tongji_nj.php @@ -41,6 +41,7 @@ class TongjiNj extends Migrator ->addColumn('chengji_cnt','integer',['limit'=>11,'null'=>true,'comment'=>'有成绩数']) ->addColumn('sum','decimal',['precision'=>10,'scale'=>1,'null'=>true,'comment'=>'总分']) ->addColumn('avg','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'平均分']) + ->addColumn('defenlv','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'得分率']) ->addColumn('biaozhuncha','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'标准差']) ->addColumn('youxiu','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'优秀']) ->addColumn('jige','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'及格']) diff --git a/database/migrations/20200106013922_tongji_bj.php b/database/migrations/20200106013922_tongji_bj.php index cd57d04a..ace59736 100644 --- a/database/migrations/20200106013922_tongji_bj.php +++ b/database/migrations/20200106013922_tongji_bj.php @@ -40,6 +40,7 @@ class TongjiBj extends Migrator ->addColumn('chengji_cnt','integer',['limit'=>11,'null'=>true,'comment'=>'有成绩数']) ->addColumn('sum','decimal',['precision'=>10,'scale'=>1,'null'=>true,'comment'=>'总分']) ->addColumn('avg','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'平均分']) + ->addColumn('defenlv','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'得分率']) ->addColumn('biaozhuncha','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'标准差']) ->addColumn('youxiu','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'优秀']) ->addColumn('jige','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'及格']) diff --git a/database/migrations/20200107045207_tongji_sch.php b/database/migrations/20200107045207_tongji_sch.php index 63b4d412..ec45727c 100644 --- a/database/migrations/20200107045207_tongji_sch.php +++ b/database/migrations/20200107045207_tongji_sch.php @@ -40,6 +40,7 @@ class TongjiSch extends Migrator ->addColumn('chengji_cnt','integer',['limit'=>11,'null'=>true,'comment'=>'有成绩数']) ->addColumn('sum','decimal',['precision'=>10,'scale'=>1,'null'=>true,'comment'=>'总分']) ->addColumn('avg','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'平均分']) + ->addColumn('defenlv','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'得分率']) ->addColumn('biaozhuncha','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'标准差']) ->addColumn('youxiu','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'优秀']) ->addColumn('jige','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'及格']) diff --git a/database/seeds/Rule.php b/database/seeds/Rule.php index d96dbe9a..05d339ff 100644 --- a/database/seeds/Rule.php +++ b/database/seeds/Rule.php @@ -161,6 +161,7 @@ class Rule extends Seeder ['title'=>'移动','name'=>'teach/Banji/yidong','paixu'=>3,'pid'=>502], ['title'=>'删除','name'=>'teach/Banji/delete','paixu'=>4,'pid'=>502], ['title'=>'状态','name'=>'teach/Banji/setStatus','paixu'=>5,'pid'=>502], + ['title'=>'成绩查看','name'=>'teach/BanjiChengji/index','paixu'=>6,'pid'=>502,], // 学科列表权限 ['title'=>'添加','name'=>'teach/Subject/create','paixu' =>1,'pid'=>503], ['title'=>'保存','name'=>'teach/Subject/save','paixu' =>2,'pid'=>503],