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();