This commit is contained in:
cxdbz committed 2019-07-06 21:05:20 +08:00
1 parent 39e1a7a58b
commit 044bb5bf0f
4 files changed
+22 -11

No files matched your search

+5 -2
View File
@@ -202,7 +202,10 @@ function teacherNames($list = array())
* @param mixed $list[''] 文件要存到哪儿
* @param mixed $file 文件
* @param array $isSave 是否将文件信息保存到数据库
* @return string 返回类型 文件在服务器地址
* @return array 返回类型 数组
* @return msg string 提示
* @return val string 结果
* @return url string 如果保存到数据库,返回完整路径,否则保存部分路径。
*/
function upload($list,$file,$isSave=false)
{
@@ -257,7 +260,7 @@ function upload($list,$file,$isSave=false)
$data = array(
'msg'=>'上传成功'
,'val'=>true
,'url'=>$myrul.$list['serurl'].$info->getSaveName()
,'url'=>$info->getSaveName()
);
}
+14 -3
View File
@@ -73,9 +73,9 @@ class Fields extends Base
$filist = $fl->where('id',$id)->find();
// 下载文件
$download = new \think\response\Download('\uploads\student\student_template.xlsx');
$download = new \think\response\Download('uploads\\'.$filist->url);
return $download->name('student_template.xlsx');
return $download->name($filist->oldname);
}
@@ -89,6 +89,17 @@ class Fields extends Base
*/
public function delete($id)
{
//
if($id == 'm')
{
$id = request()->delete('ids');
}
$data = FL::destroy($id);
// 根据更新结果设置返回提示信息
$data ? $data=['msg'=>'删除成功','val'=>1] : $data=['msg'=>'数据处理错误','val'=>0];
// 返回信息
return json($data);
}
}
+3 -6
View File
@@ -49,9 +49,6 @@
<button class="layui-btn layui-btn-danger" lay-event="dels">
<i class="iconfont">&#xe69d;</i> 批量删除
</button>
<button class="layui-btn" lay-event="add">
<i class="iconfont">&#xe6b9;</i> 添加
</button>
</div>
</script>
<!-- 记录操作按钮模板 -->
@@ -93,10 +90,10 @@
switch(obj.event){
case 'dels':
var checkStatus = table.checkStatus('mytable'); //idmytable 即为基础参数 id 对应的值
cjgl.delAll(checkStatus,'/school','mytable');
cjgl.delAll(checkStatus,'/fields','mytable');
break;
case 'add':
cjgl.add('添加单位','/school/create','650','500');
cjgl.add('添加文件','/fields/create','650','500');
break;
};
});
@@ -111,7 +108,7 @@
cjgl.del(obj,"/fields");
break;
case 'download':// 编辑
cjgl.add('下载文件','/fields/dwonload/'+obj.data.id,'650','500');
cjgl.add('下载文件','/system/Fields/download/id/'+obj.data.id,'650','500');
break;
};
});
Loaded 3 of 4 files, more files were not shown because too many files have changed in this diff. Show more