From 168a990a7e6b07adb07615e04698f65776f49436 Mon Sep 17 00:00:00 2001 From: twsystem1004 Date: Tue, 14 Jul 2026 05:16:29 +0000 Subject: [PATCH] =?UTF-8?q?feat(=E5=80=89=E5=BA=AB):=20=E6=A9=9F=E5=8F=B0?= =?UTF-8?q?=E5=BA=AB=E5=AD=98=E5=8C=AF=E5=87=BA=20Excel=20=E5=8A=A0?= =?UTF-8?q?=E3=80=8C=E5=95=86=E5=93=81ID=E3=80=8D=E6=AC=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 機台庫存概覽批次匯出(多分頁)與單機台詳細匯出的欄位,於貨道號後、商品名稱前 新增「商品ID」欄;空貨道商品ID留空。 Co-Authored-By: Claude Opus 4.8 (1M context) --- app/Http/Controllers/Admin/WarehouseController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Admin/WarehouseController.php b/app/Http/Controllers/Admin/WarehouseController.php index 2ce49e4..3b3c8c4 100644 --- a/app/Http/Controllers/Admin/WarehouseController.php +++ b/app/Http/Controllers/Admin/WarehouseController.php @@ -745,7 +745,7 @@ class WarehouseController extends Controller ->orderByRaw('CAST(slot_no AS UNSIGNED) ASC') ->get(); - $headers = ['貨道號', '商品名稱', '商品條碼', '類型', '目前庫存', '滿庫容量', '庫存率(%)', '效期', '批號', '啟用', '鎖定']; + $headers = ['貨道號', '商品ID', '商品名稱', '商品條碼', '類型', '目前庫存', '滿庫容量', '庫存率(%)', '效期', '批號', '啟用', '鎖定']; $safeSerial = preg_replace('/[^A-Za-z0-9_-]/', '', (string) $machine->serial_no); $filename = '貨道明細_' . ($safeSerial ?: $machine->id) . '_' . now()->format('YmdHis') . '.' . $ext; @@ -772,6 +772,7 @@ class WarehouseController extends Controller $row = [ $slot->slot_no, + $slot->product_id ?? '', $slot->product->name ?? '', $slot->product->barcode ?? '', $slot->type, @@ -829,7 +830,7 @@ class WarehouseController extends Controller } $machines = $query->get(); - $headers = ['貨道號', '商品名稱', '商品條碼', '類型', '目前庫存', '滿庫容量', '庫存率(%)', '效期', '批號', '啟用', '鎖定']; + $headers = ['貨道號', '商品ID', '商品名稱', '商品條碼', '類型', '目前庫存', '滿庫容量', '庫存率(%)', '效期', '批號', '啟用', '鎖定']; $ts = now()->format('YmdHis'); // 單台的資料列 @@ -841,6 +842,7 @@ class WarehouseController extends Controller $rate = $capacity > 0 ? round($stock / $capacity * 100) : 0; $rows[] = [ (string) $slot->slot_no, + $slot->product_id ?? '', $slot->product->name ?? '', $slot->product->barcode ?? '', (string) $slot->type,