feat: 添加导入模版

master
yin5th 2023-10-12 17:04:06 +08:00
parent 5627394521
commit 41e2eaf769
3 changed files with 10 additions and 0 deletions

View File

@ -451,4 +451,13 @@ class Goods extends AdminBase
]);
}
public function importTemplate()
{
$fullPath = public_path().'static/admin/images/import_demo.xlsx';
if (file_exists($fullPath)) {
return download($fullPath, '商品导入模版.xlsx');
}
echo '文件不存在';exit;
}
}

View File

@ -11,6 +11,7 @@
<label class="layui-form-label"></label>
<div class="layui-input-block">
<button class="layui-btn layui-btn-sm layui-btn-normal" id="import" data-shop="0">上传文件</button>
<a class="layui-btn layui-btn-sm layui-btn-warm" href="{:url('goods.goods/importTemplate')}" target="_blank">导入模版</a>
</div>
</div>
<!-- <div class="layui-form-item layui-hide">-->

Binary file not shown.