修复成绩排序错误

This commit is contained in:
cxdbz committed 2019-06-09 13:50:34 +08:00
1 parent 349b8b0a1c
commit ffa0f77476
2 files changed
+9 -36

No files matched your search

-27
View File
@@ -57,33 +57,6 @@ class Index extends Base
}
public function edit($id)
{
// 获取该学生成绩信息
$cj = Chengji::where('id',$id)->append(['cj_kaoshi.title','cj_student.xingming'])->find();
// 模板赋值
$this->assign('list',$cj);
// 渲染
return $this->fetch();
}
// // 保存扫码录入成绩
// public function save($id)
// {
// // 获取表单数据
// $list = request()->param();
// // 更新成绩
// $data = Chengji::update($list);
// // 判断返回内容
// $data ? $data=['msg'=>'录入成功','val'=>1] : $data=['msg'=>'数据处理错误','val'=>0];
// // 返回更新结果
// return $data;
// }
// 学生成绩表中修改成绩
public function update($id) #id为考号ID
{
+9 -9
View File
@@ -219,14 +219,6 @@ function upload($list,$file,$isSave=false)
// 如果需要保存文件
if($isSave == true){
// 判断文件是否已经上传,如果已经上传则退出
// if($field->hasHash($list['hash'])){
// $data = array(
// 'msg'=>'文件不能重复上传。',
// 'val'=>0
// );
// return $data;
// }
//将文件信息保存
$data = $field->create($list);
@@ -283,6 +275,10 @@ function arraySequence($array, $field = 'id', $sort = 'desc') {
$array[$x] = $array[$x+1];
$array[$x+1] = $temp;
}
}elseif(!isset($array[$x+1][$field])){
$temp = $array[$x];
$array[$x] = $array[$x+1];
$array[$x+1] = $temp;
}
}
}
@@ -298,7 +294,11 @@ function arraySequence($array, $field = 'id', $sort = 'desc') {
$array[$x] = $array[$x+1];
$array[$x+1] = $temp;
}
}
}elseif(!isset($array[$x][$field])){
$temp = $array[$x];
$array[$x] = $array[$x+1];
$array[$x+1] = $temp;
}
}
}
}