diff --git a/app/chengji/model/TongjiSch.php b/app/chengji/model/TongjiSch.php index 49887a3f..2631f229 100755 --- a/app/chengji/model/TongjiSch.php +++ b/app/chengji/model/TongjiSch.php @@ -107,7 +107,7 @@ class TongjiSch extends BaseModel ->field('kaoshi_id, ruxuenian') ->with([ 'schJieguo' => function ($query) use ($src) { - $query->field('subject_id, ruxuenian, chengji_cnt, avg, youxiu, jige') + $query->field('stu_cnt, chengji_cnt, sum, avg, defenlv, biaozhuncha, youxiu, jige, max, min, q1, q2, q3, zhongshu, zhongweishu, subject_id, ruxuenian') ->where('kaoshi_id', $src['kaoshi_id']) ->with([ 'schSubject' => function($query){ @@ -131,10 +131,25 @@ class TongjiSch extends BaseModel foreach ($value->schJieguo as $k => $val) { if ($val->subject_id > 0) { $data['all']['chengji'][$val->schSubject->lieming] = [ - 'avg' => $val->avg + 'stu_cnt' => $val->stu_cnt + ,'chengji_cnt' => $val->chengji_cnt + ,'sum' => $val->sum + ,'avg' => $val->avg + ,'defenlv' => $val->defenlv + ,'biaozhuncha' => $val->biaozhuncha + ,'youxiu' => $val->youxiu ,'youxiulv' => $val->youxiulv + ,'jige' => $val->jige ,'jigelv' => $val->jigelv - ,'cjCnt' => $val->chengji_cnt + ,'max' => $val->max + ,'min' => $val->min + ,'q1' => $val->q1 + ,'q2' => $val->q2 + ,'q3' => $val->q3 + ,'zhongshu' => $val->zhongshu + ,'zhongweishu' => $val->zhongweishu + ,'chashenglv' => $val->chashenglv + ,'canshilv' => $val->canshilv ]; }else{ $data['all']['quanke'] = [ @@ -199,7 +214,7 @@ class TongjiSch extends BaseModel public function schJieguo() { $data = $this->hasMany('\app\chengji\model\TongjiSch', 'ruxuenian', 'ruxuenian') - ->append(['youxiulv', 'jigelv']); + ->append(['youxiulv', 'jigelv', 'chashenglv', 'canshilv']); return $data; } @@ -231,4 +246,32 @@ class TongjiSch extends BaseModel return $jige; } + + // 差生率 + function getChashenglvAttr() + { + $cjCnt = $this->chengji_cnt; + $chaCnt = $cjCnt - $this->jige; + $chalv = 0; + if ($cjCnt > 0) { + $chalv = round($chaCnt / $cjCnt * 100, 2); + } + + return $chalv; + } + + + // 参试率 + function getCanshilvAttr() + { + $cjCnt = $this->chengji_cnt; + $stu_cnt = $this->stu_cnt; + $canshilv = 0; + if ($stu_cnt > 0) { + $chalv = round($cjCnt / $stu_cnt * 100, 2); + } + + return $chalv; + } + } diff --git a/app/chengji/view/njtongji/biaoge.html b/app/chengji/view/njtongji/biaoge.html index 26a63b4f..e261531a 100755 --- a/app/chengji/view/njtongji/biaoge.html +++ b/app/chengji/view/njtongji/biaoge.html @@ -65,7 +65,7 @@ // 获取学科 var xk = ''; xk = eval(decodeURIComponent(xk)); - + var xiangmu = ''; xiangmu = eval(decodeURIComponent(xiangmu)); xiangmuCnt = xiangmu.length; @@ -83,7 +83,7 @@ { if(d.chengji[colname]) { - str = d.chengji[colname][i]; + str = d.chengji[colname][val.biaoshi]; } } return str; diff --git a/app/login/view/index/shangma_log.html b/app/login/view/index/shangma_log.html index ed8b4057..e42f86be 100755 --- a/app/login/view/index/shangma_log.html +++ b/app/login/view/index/shangma_log.html @@ -57,6 +57,7 @@ 修改系统默认类别
增加成绩统计项目设置和学生查询时成绩显示方式设置
增加差生率和参与率统计
+ 增加统计项目设置
兼容Linux操作系统
增加基础数据
修复已知错误
diff --git a/database/seeds/Category.php b/database/seeds/Category.php index a3cd036b..69446c65 100755 --- a/database/seeds/Category.php +++ b/database/seeds/Category.php @@ -294,9 +294,6 @@ class Category extends Seeder ['id' => 12208,'title' => '教师-各学生-网页','p_id' => 122,'paixu' => 8,'isupdate' => 0], ['id' => 12209,'title' => '学生-各考试-网页','p_id' => 122,'paixu' => 9,'isupdate' => 0], ['id' => 12210,'title' => '管理员-学生-下载左','p_id' => 122,'paixu' => 10,'isupdate' => 0], - ['id' => 12211,'title' => '管理员-各年级-网页','p_id' => 122,'paixu' => 11,'isupdate' => 0], - ['id' => 12212,'title' => '管理员-各年级-下载','p_id' => 122,'paixu' => 12,'isupdate' => 0], - ]; // 保存数据 $this->table('category')->insert($rows)->save(); diff --git a/database/seeds/TongjiXingmu.php b/database/seeds/TongjiXingmu.php index 49428243..1f4ea1ea 100755 --- a/database/seeds/TongjiXingmu.php +++ b/database/seeds/TongjiXingmu.php @@ -1019,268 +1019,6 @@ class TongjiXingmu extends Seeder ,'paixu' => 6 ,'category_id' => 12209 ] - - - // 管理员-各年级-网页 - ,[ - 'title' => '学号数' - ,'biaoshi' => 'stu_cnt' - ,'tongji' => 0 - ,'paixu' => 1 - ,'category_id' => 12211 - ] - ,[ - 'title' => '成绩数' - ,'biaoshi' => 'chengji_cnt' - ,'tongji' => 1 - ,'paixu' => 2 - ,'category_id' => 12211 - ] - ,[ - 'title' => '总分' - ,'biaoshi' => 'sum' - ,'tongji' => 0 - ,'paixu' => 3 - ,'category_id' => 12211 - ] - ,[ - 'title' => '平均分' - ,'biaoshi' => 'avg' - ,'tongji' => 1 - ,'paixu' => 4 - ,'category_id' => 12211 - ] - ,[ - 'title' => '得分率' - ,'biaoshi' => 'defenlv' - ,'tongji' => 0 - ,'paixu' => 5 - ,'category_id' => 12211 - ] - ,[ - 'title' => '标准差' - ,'biaoshi' => 'biaozhuncha' - ,'tongji' => 0 - ,'paixu' => 6 - ,'category_id' => 12211 - ] - ,[ - 'title' => '优秀人数' - ,'biaoshi' => 'youxiu' - ,'tongji' => 0 - ,'paixu' => 7 - ,'category_id' => 12211 - ] - ,[ - 'title' => '优秀率' - ,'biaoshi' => 'youxiulv' - ,'tongji' => 1 - ,'paixu' => 8 - ,'category_id' => 12211 - ] - ,[ - 'title' => '及格人数' - ,'biaoshi' => 'jige' - ,'tongji' => 0 - ,'paixu' => 9 - ,'category_id' => 12211 - ] - ,[ - 'title' => '及格率' - ,'biaoshi' => 'jigelv' - ,'tongji' => 1 - ,'paixu' => 10 - ,'category_id' => 12211 - ] - ,[ - 'title' => '最高分' - ,'biaoshi' => 'max' - ,'tongji' => 0 - ,'paixu' => 11 - ,'category_id' => 12211 - ] - ,[ - 'title' => '最低分' - ,'biaoshi' => 'min' - ,'tongji' => 0 - ,'paixu' => 12 - ,'category_id' => 12211 - ] - ,[ - 'title' => 'Q1' - ,'biaoshi' => 'q1' - ,'tongji' => 0 - ,'paixu' => 13 - ,'category_id' => 12211 - ] - ,[ - 'title' => 'Q2' - ,'biaoshi' => 'q2' - ,'tongji' => 0 - ,'paixu' => 14 - ,'category_id' => 12211 - ] - ,[ - 'title' => 'Q3' - ,'biaoshi' => 'q3' - ,'tongji' => 0 - ,'paixu' => 15 - ,'category_id' => 12211 - ] - ,[ - 'title' => '众数' - ,'biaoshi' => 'zhongshu' - ,'tongji' => 0 - ,'paixu' => 16 - ,'category_id' => 12211 - ] - ,[ - 'title' => '中位数' - ,'biaoshi' => 'zhongweishu' - ,'tongji' => 0 - ,'paixu' => 17 - ,'category_id' => 12211 - ] - ,[ - 'title' => '差生率' - ,'biaoshi' => 'chashenglv' - ,'tongji' => 0 - ,'paixu' => 18 - ,'category_id' => 12211 - ] - - - // 管理员-各年级-下载 - ,[ - 'title' => '学号数' - ,'biaoshi' => 'stu_cnt' - ,'tongji' => 0 - ,'paixu' => 1 - ,'category_id' => 12212 - ] - ,[ - 'title' => '成绩数' - ,'biaoshi' => 'chengji_cnt' - ,'tongji' => 1 - ,'paixu' => 2 - ,'category_id' => 12212 - ] - ,[ - 'title' => '总分' - ,'biaoshi' => 'sum' - ,'tongji' => 0 - ,'paixu' => 3 - ,'category_id' => 12212 - ] - ,[ - 'title' => '平均分' - ,'biaoshi' => 'avg' - ,'tongji' => 1 - ,'paixu' => 4 - ,'category_id' => 12212 - ] - ,[ - 'title' => '得分率' - ,'biaoshi' => 'defenlv' - ,'tongji' => 0 - ,'paixu' => 5 - ,'category_id' => 12212 - ] - ,[ - 'title' => '标准差' - ,'biaoshi' => 'biaozhuncha' - ,'tongji' => 0 - ,'paixu' => 6 - ,'category_id' => 12212 - ] - ,[ - 'title' => '优秀人数' - ,'biaoshi' => 'youxiu' - ,'tongji' => 0 - ,'paixu' => 7 - ,'category_id' => 12212 - ] - ,[ - 'title' => '优秀率' - ,'biaoshi' => 'youxiulv' - ,'tongji' => 1 - ,'paixu' => 8 - ,'category_id' => 12212 - ] - ,[ - 'title' => '及格人数' - ,'biaoshi' => 'jige' - ,'tongji' => 0 - ,'paixu' => 9 - ,'category_id' => 12212 - ] - ,[ - 'title' => '及格率' - ,'biaoshi' => 'jigelv' - ,'tongji' => 1 - ,'paixu' => 10 - ,'category_id' => 12212 - ] - ,[ - 'title' => '最高分' - ,'biaoshi' => 'max' - ,'tongji' => 0 - ,'paixu' => 11 - ,'category_id' => 12212 - ] - ,[ - 'title' => '最低分' - ,'biaoshi' => 'min' - ,'tongji' => 0 - ,'paixu' => 12 - ,'category_id' => 12212 - ] - ,[ - 'title' => 'Q1' - ,'biaoshi' => 'q1' - ,'tongji' => 0 - ,'paixu' => 13 - ,'category_id' => 12212 - ] - ,[ - 'title' => 'Q2' - ,'biaoshi' => 'q2' - ,'tongji' => 0 - ,'paixu' => 14 - ,'category_id' => 12212 - ] - ,[ - 'title' => 'Q3' - ,'biaoshi' => 'q3' - ,'tongji' => 0 - ,'paixu' => 15 - ,'category_id' => 12212 - ] - ,[ - 'title' => '众数' - ,'biaoshi' => 'zhongshu' - ,'tongji' => 0 - ,'paixu' => 16 - ,'category_id' => 12212 - ] - ,[ - 'title' => '中位数' - ,'biaoshi' => 'zhongweishu' - ,'tongji' => 0 - ,'paixu' => 17 - ,'category_id' => 12212 - ] - ,[ - 'title' => '差生率' - ,'biaoshi' => 'chashenglv' - ,'tongji' => 0 - ,'paixu' => 18 - ,'category_id' => 12212 - ] - - - - ]; // 保存数据 $this->table('tongji_xiangmu')->insert($rows)->save();