6
0
Fork 0

下载商品末班

release
panliang 2022-05-20 10:34:36 +08:00
parent 73ed204da2
commit fc67994eb4
5 changed files with 1 additions and 8 deletions

View File

@ -11,7 +11,7 @@ class ProductDownloadTemplate extends AbstractTool
{ {
protected function html() protected function html()
{ {
$url = admin_url('product-spus/download-template'); $url = url('goods.xlsx');
return <<<HTML return <<<HTML
<a href="{$url}" target="_blank" class="btn btn-white waves-effect">下载商品模板</a> <a href="{$url}" target="_blank" class="btn btn-white waves-effect">下载商品模板</a>
HTML; HTML;

View File

@ -237,9 +237,4 @@ class ProductSpuController extends AdminController
->description($spu->name) ->description($spu->name)
->body(ProductSkuTable::grid($spu->id)); ->body(ProductSkuTable::grid($spu->id));
} }
public function downloadTemplate()
{
return Storage::disk('local')->download('excel-template/goods.xlsx', '导入商品模板.xlsx');
}
} }

View File

@ -53,7 +53,6 @@ Route::group([
'index', 'create', 'store', 'edit', 'update', 'destroy', 'index', 'create', 'store', 'edit', 'update', 'destroy',
])->names('product_buynotes'); ])->names('product_buynotes');
$router->get('product-spus/download-template', 'ProductSpuController@downloadTemplate');
$router->resource('product-spus', 'ProductSpuController')->names('product_spus'); $router->resource('product-spus', 'ProductSpuController')->names('product_spus');
$router->get('product-spus/{spu}/sku-list', 'ProductSpuController@skuList')->name('product_spus.sku_list'); $router->get('product-spus/{spu}/sku-list', 'ProductSpuController@skuList')->name('product_spus.sku_list');

BIN
public/goods.xlsx 100644

Binary file not shown.

View File

@ -1,4 +1,3 @@
* *
!excel-template
!public/ !public/
!.gitignore !.gitignore