From 86554e20d520e005c345c79fb0ab184b454d6645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=BB=BA=E7=82=8A?= <924182103@qq.com> Date: Wed, 30 Oct 2024 15:27:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=B9=E9=87=8F=E4=BF=AE=E6=94=B9=E5=9C=A8?= =?UTF-8?q?=E5=94=AE=E5=BA=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Exports/GoodsSkusExport.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Exports/GoodsSkusExport.php b/app/Exports/GoodsSkusExport.php index 2cd448d..c9d311f 100644 --- a/app/Exports/GoodsSkusExport.php +++ b/app/Exports/GoodsSkusExport.php @@ -38,14 +38,14 @@ class GoodsSkusExport implements FromCollection, ShouldAutoSize $headTitle = [ '商品编码', '商品名称', - '在售库存', + '可售库存', '创建时间', ]; $map = [ 'cost' => ['当前成本', '更新前成本', "更新后成本"], 'inventory' => ['当前库存', '盘点数', '采购总数'], ]; - $headTitle = array_merge($headTitle, $map[$this->type]); + $headTitle = array_merge($headTitle, $map[$this->type] ?? []); if ('cost' === $this->type) { $update = $this->getChangeCostLogs(); } @@ -63,7 +63,7 @@ class GoodsSkusExport implements FromCollection, ShouldAutoSize } if ($this->type === "goods_combination") { $builder->where('is_combination', 1); - }else{ + } else { $builder->where('is_combination', 0); } $data = $builder->filter()->orderByDesc('id')->get()->toArray();