From 7ada42695ac683ba75bfa944e2a79ee7a03dc42e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=B8=96=E7=95=8C?= <642747453@qq.com> Date: Thu, 4 Aug 2022 18:20:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20#20220804=20=E6=96=B0=E5=A2=9E=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=AF=BC=E5=85=A5=E6=A8=A1=E6=9D=BF=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Goods/GoodsController.php | 6 ++++++ routes/web.php | 3 +++ 2 files changed, 9 insertions(+) diff --git a/app/Http/Controllers/Goods/GoodsController.php b/app/Http/Controllers/Goods/GoodsController.php index 234752e..1d25ed8 100644 --- a/app/Http/Controllers/Goods/GoodsController.php +++ b/app/Http/Controllers/Goods/GoodsController.php @@ -13,6 +13,7 @@ use Illuminate\Support\Facades\Validator; use App\Models\Goods; use App\Http\Requests\GoodsRequest; use App\Models\DailyStockRecord; +use Illuminate\Support\Facades\Storage; class GoodsController extends Controller { @@ -85,4 +86,9 @@ class GoodsController extends Controller return response($this->res, $this->res['httpCode']); } + + public function download() + { + return Storage::download(resource_path('templates/goods_skus_import.xlsx')); + } } diff --git a/routes/web.php b/routes/web.php index b342af8..20cc097 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,6 +1,7 @@ name('register'); Route::get('goods_skus/export', [GoodsSkusController::class, 'export'])->name('goods_skus.export')->middleware('check.permissions'); + +Route::get('goods/import/template', [GoodsController::class, 'download'])->name('download.goods_import.template');