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

+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;
};
});