diff --git a/server/app/admin/controller/goods/Goods.php b/server/app/admin/controller/goods/Goods.php index 1e860d11..12ee7fd3 100644 --- a/server/app/admin/controller/goods/Goods.php +++ b/server/app/admin/controller/goods/Goods.php @@ -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; + } } \ No newline at end of file diff --git a/server/app/admin/view/goods/goods/import.html b/server/app/admin/view/goods/goods/import.html index 535fd4f6..ea0cb2ea 100644 --- a/server/app/admin/view/goods/goods/import.html +++ b/server/app/admin/view/goods/goods/import.html @@ -11,6 +11,7 @@
+ 导入模版
diff --git a/server/public/static/admin/images/import_demo.xlsx b/server/public/static/admin/images/import_demo.xlsx new file mode 100644 index 00000000..c00ca09d Binary files /dev/null and b/server/public/static/admin/images/import_demo.xlsx differ