From ffa0f77476633d14f8665881622e594532a4f4aa Mon Sep 17 00:00:00 2001 From: cxdbz Date: Sun, 9 Jun 2019 13:50:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=88=90=E7=BB=A9=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/chengji/controller/Index.php | 27 ------------------------ application/common.php | 18 ++++++++-------- 2 files changed, 9 insertions(+), 36 deletions(-) diff --git a/application/chengji/controller/Index.php b/application/chengji/controller/Index.php index 2a55e7ae..74a8ecba 100644 --- a/application/chengji/controller/Index.php +++ b/application/chengji/controller/Index.php @@ -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 { diff --git a/application/common.php b/application/common.php index 6c7f0cb3..1f1bbbb7 100644 --- a/application/common.php +++ b/application/common.php @@ -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; + } } } }