修改成绩数据模型
This commit is contained in:
1 parent
27a9be6b50
commit
1476a43bf8
4 files changed
+16
-50
No files matched your search
@@ -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()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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查询考试成绩
|
||||
|
||||
@@ -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);
|
||||
|
||||
Loaded 3 of 4 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user