diff --git a/application/chengji/controller/Index.php b/application/chengji/controller/Index.php index 36eac5fb..371f9b04 100644 --- a/application/chengji/controller/Index.php +++ b/application/chengji/controller/Index.php @@ -152,11 +152,12 @@ class Index extends Base // 判断成绩更新结果 empty($cj) ? $data = ['msg'=>'上传失败','val' => 0] : $data = ['msg'=>'上传成功','val' => 1,]; + ob_flush(); + flush(); // 返回成绩结果 return json($data); - ob_flush(); - flush(); + } @@ -360,5 +361,13 @@ class Index extends Base return json($data); } + + + // 下载成绩表格 + public function download() + { + + } + } diff --git a/application/chengji/model/Chengji.php b/application/chengji/model/Chengji.php index 330efb91..e6ce1eb2 100644 --- a/application/chengji/model/Chengji.php +++ b/application/chengji/model/Chengji.php @@ -80,38 +80,6 @@ class Chengji extends Base - // 语文成绩获取器 - public function getYuwenAttr($val) - { - return $this->myval($val); - } - - // 数学成绩获取器 - public function getShuxueAttr($val) - { - return $this->myval($val); - } - - // 外语成绩获取器 - public function getWaiyuAttr($val) - { - return $this->myval($val); - } - - // 总分成绩获取器 - public function getStuSumAttr($val) - { - return $this->myval($val); - } - - // 平均分成绩获取器 - public function getStuAvgAttr($val) - { - return $this->myval($val); - } - - - // 班级名称(数字)获取器 public function getBanjiNumnameAttr() { @@ -123,12 +91,6 @@ class Chengji extends Base } - // 格式化成绩 - public function myval($val) - { - $val == 0 ? $val='' : $val = $val*1; - return $val; - } // 查询根据考试ID查询考试成绩 diff --git a/application/chengji/model/Tongji.php b/application/chengji/model/Tongji.php index e36a29b8..1386ac9e 100644 --- a/application/chengji/model/Tongji.php +++ b/application/chengji/model/Tongji.php @@ -44,16 +44,6 @@ class Tongji extends Model } }); $jige = count($jg); - // 获取及格人数 - // $youxiu = $cjlist->filter(function ($data) use($youxiu,$lieming) { - // return $data[$lieming] >= $youxiu; - // })->count(); - - // 获取及格人数 - // $jg = $value['jige']; - // $jige = $cjlist->filter(function ($data) use($jg,$lieming) { - // return $data[$lieming] >= $jg; - // })->count(); // 计算成绩 $data[$value['lieming']] = $this->tjxueke($xkchengji,$cnt,$youxiu,$jige); diff --git a/application/chengji/view/index/chengjilist.html b/application/chengji/view/index/chengjilist.html index 104dbaa8..10a8bce9 100644 --- a/application/chengji/view/index/chengjilist.html +++ b/application/chengji/view/index/chengjilist.html @@ -20,6 +20,11 @@ 批量删除 + + + + 下载成绩 + 共有数据:{$list.count} 条