feat: 添加导入模版
parent
5627394521
commit
41e2eaf769
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -11,6 +11,7 @@
|
||||||
<label class="layui-form-label"></label>
|
<label class="layui-form-label"></label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<button class="layui-btn layui-btn-sm layui-btn-normal" id="import" data-shop="0">上传文件</button>
|
<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>
|
</div>
|
||||||
<!-- <div class="layui-form-item layui-hide">-->
|
<!-- <div class="layui-form-item layui-hide">-->
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue