diff --git a/app/chengji/controller/Luru.php b/app/chengji/controller/Luru.php index 7a55281c..882d4109 100644 --- a/app/chengji/controller/Luru.php +++ b/app/chengji/controller/Luru.php @@ -275,7 +275,7 @@ class Luru extends BaseController // 读取表格数据 $excel = new \app\student\controller\Myexcel; - $cjinfo = $excel->readXls(public_path() . 'public\\uploads\\' . $list['url']); + $cjinfo = $excel->readXls(public_path() . 'uploads\\' . $list['url']); $kaoshi_id = $cjinfo[1][0]; #获取考号 $nianji = $cjinfo[1][1]; #获取年级 diff --git a/app/kaohao/controller/Excel.php b/app/kaohao/controller/Excel.php index 1b971dd9..4ea3a800 100644 --- a/app/kaohao/controller/Excel.php +++ b/app/kaohao/controller/Excel.php @@ -142,6 +142,7 @@ class Excel extends BaseController ob_flush(); flush(); + exit(); } @@ -304,5 +305,6 @@ class Excel extends BaseController $writer->save('php://output'); ob_flush(); flush(); + exit(); } } diff --git a/app/kaoshi/view/kaoshi_set/create.html b/app/kaoshi/view/kaoshi_set/create.html index 3eb9e5aa..adcbf3ea 100644 --- a/app/kaoshi/view/kaoshi_set/create.html +++ b/app/kaoshi/view/kaoshi_set/create.html @@ -87,8 +87,8 @@ // 选中复选框 $(mydiv).find("td:eq(0)").children("input").prop('checked',true); // 设置优秀率和及格率 - $(mydiv).find("td:eq(3)").children("input:eq(0)").val(val*0.9); - $(mydiv).find("td:eq(4)").children("input:eq(0)").val(val*0.6); + $(mydiv).find("td:eq(3)").children("input:eq(0)").val(Math.round(val*0.9)); + $(mydiv).find("td:eq(4)").children("input:eq(0)").val(Math.round(val*0.6)); }else{ // 选中复选框 $(mydiv).find("td:eq(0)").children("input").prop('checked',false); diff --git a/app/kaoshi/view/kaoshi_set/edit.html b/app/kaoshi/view/kaoshi_set/edit.html index 1a6daa96..a51f8d4e 100644 --- a/app/kaoshi/view/kaoshi_set/edit.html +++ b/app/kaoshi/view/kaoshi_set/edit.html @@ -64,10 +64,10 @@ manfen = $('#manfen').val(); var regPos = /^\d+(\.\d+)?$/; //非负浮点数 if(regPos.test(manfen)){ - $('#youxiu').val(manfen * 0.9); - $('#jige').val(manfen * 0.6); + $('#youxiu').val(Math.round(manfen * 0.9)); + $('#jige').val(Math.round(manfen * 0.6)); }else{ - layer.msg('请填写数字'); + layer.msg('请填写整数'); } } diff --git a/app/rongyu/model/DwRongyuCanyu.php b/app/rongyu/model/DwRongyuCanyu.php index f283504d..daafa9e8 100644 --- a/app/rongyu/model/DwRongyuCanyu.php +++ b/app/rongyu/model/DwRongyuCanyu.php @@ -21,7 +21,7 @@ class DwRongyuCanyu extends BaseModel // 教师关联 public function teacher() { - return $this->belongsTo('\app\renshi\model\Teacher', 'teacher_id', 'id'); + return $this->belongsTo('\app\teacher\model\Teacher', 'teacher_id', 'id'); } } diff --git a/app/student/controller/Index.php b/app/student/controller/Index.php index 9b9275dc..2cf441ff 100644 --- a/app/student/controller/Index.php +++ b/app/student/controller/Index.php @@ -450,7 +450,7 @@ class Index extends BaseController // 读取表格数据 $excel = new Myexcel(); - $stuinfo = $excel->readXls(public_path() . 'public\\uploads\\' . $list['url']); + $stuinfo = $excel->readXls(public_path() . 'uploads\\' . $list['url']); if($stuinfo[0][2] != "序号" && $stuinfo[1][2] != "姓名" && $stuinfo[2][2] != "身份证号") { $this->error('请使用模板上传', '/login/err'); #如果表格数据与模板不相符,则跳转。 @@ -530,7 +530,7 @@ class Index extends BaseController // 读取表中数据 $excel = new Myexcel(); - $stuinfo = $excel->readXls(public_path() . 'public\\uploads\\' . $list['url']); + $stuinfo = $excel->readXls(public_path() . 'uploads\\' . $list['url']); // 判断表格是否正确 if($stuinfo[0][2] != "序号" && $stuinfo[1][2] != "ID" && $stuinfo[2][2] != "班级" && $stuinfo[3][2] != "姓名") @@ -562,7 +562,7 @@ class Index extends BaseController // 下载表格模板 public function download() { - $url = public_path() . 'public\\uploads\\student\\student_template.xlsx'; + $url = public_path() . 'uploads\\student\\student_template.xlsx'; return download($url,'学生名单模板.xlsx'); } diff --git a/app/teacher/controller/Index.php b/app/teacher/controller/Index.php index 6607aa50..0406a7e2 100644 --- a/app/teacher/controller/Index.php +++ b/app/teacher/controller/Index.php @@ -385,8 +385,8 @@ class Index extends BaseController ], 'POST'); // 实例化操作表格类 - $excel = new \app\student\controller\Myexcel;; - $teacherinfo = $excel->readXls(public_path() . 'public\\uploads\\' . $list['url']); + $excel = new \app\student\controller\Myexcel; + $teacherinfo = $excel->readXls(public_path() . 'uploads\\' . $list['url']); // 判断表格是否正确 if("教师基本情况表" != $teacherinfo[0][0] || '姓名*' != $teacherinfo[2][1] || '性别*' != $teacherinfo[2][2]) @@ -441,7 +441,8 @@ class Index extends BaseController // 下载表格模板 public function downloadXls() { - $url = public_path() . 'public\\uploads\\teacher\\TeacherInfo.xlsx'; + $url = public_path() . 'uploads\\teacher\\TeacherInfo.xlsx'; + halt($url); return download($url, '教师名单模板.xlsx'); }