-
欢迎『{$list.group}』:
- {$list['xingming']}!当前时间:
+ 欢迎『{$list.group}』
+ {$list['xingming']} 当前时间:
diff --git a/app/middleware/Auth.php b/app/middleware/Auth.php
index 82a8e1c1..101867d5 100644
--- a/app/middleware/Auth.php
+++ b/app/middleware/Auth.php
@@ -53,7 +53,7 @@ class Auth
// 批量保存
'saveall',
// 下载成绩表、下载成绩统计表
- 'dwchengjixlsx','dwbanjixlsx','dwnianjixlsx',
+ 'dwchengjixlsx','dwbanjixls','dwnianjixlsx',
//保存考号、下载试卷标签、下载成绩采集表
'updateset','biaoqianxls','dwcaiji',
//课题结题图片上传和更新
diff --git a/app/renshi/common.php b/app/renshi/common.php
index 5f621351..4794dbf1 100644
--- a/app/renshi/common.php
+++ b/app/renshi/common.php
@@ -65,34 +65,6 @@ function srcZc($str)
}
-// 下载文件
-function smDownload($url,$newname='')
-{
- $file = $url;
-
- if(strlen($newname)==0)
- {
- $newname = filesize($file);
- }
-
-
- if (file_exists($file)) {
- header('Content-Description: File Transfer');
- header('Content-Type: application/octet-stream');
- header('Content-Disposition: attachment; filename='.$newname);
- header('Content-Transfer-Encoding: binary');
- header('Expires: 0');
- header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
- header('Pragma: public');
- header('Content-Length: ' . filesize($file));
- ob_clean();
- flush();
- readfile($file);
- exit;
- }
-}
-
-
/**
* 将“一年级一班”格式的班级名转换成入学年和班级排序
diff --git a/app/system/controller/Fields.php b/app/system/controller/Fields.php
index 247780b3..82c66005 100644
--- a/app/system/controller/Fields.php
+++ b/app/system/controller/Fields.php
@@ -75,30 +75,16 @@ class Fields extends BaseController
$fl = new FL;
// 查询文件信息
$filist = $fl->where('id',$id)->find();
+ if($filist->oldname == null)
+ {
+ $oldname = $filist->newname;
+ }else{
+ $oldname = $filist->oldname;
+ }
$url = public_path().'public\\uploads\\'.$filist->url;
- $name = $filist->oldname;
-
- // 临时代替代码
- if(!file_exists($url))
- {
- echo "文件找不到";
- return true;
- }else{
- header('content-type:text/html;charset=utf8');
- header('Content-Description: File Transfer');
- header('Content-Type: application/octet-stream');
- header('Content-Disposition: attachment; filename='.basename($url));
- header('Content-Transfer-Encoding: binary');
- header('Expires: 0');
- header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
- header('Pragma: public');
- header('Content-Length:'.filesize($url));
- readfile($url);
- }
- $data = ['msg'=>'数据上传成功','val'=>1];
-
- // return download($url,$name);
+ return smDownload($url,$oldname);
+
}