From 3600c7b12bdfb57825ce5ecf55e6652b2fd22cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Thu, 5 Mar 2026 21:59:24 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[=ED=92=88=EC=A7=88=EA=B4=80=EB=A6=AC]?= =?UTF-8?q?=20=EC=88=98=EC=A3=BC=EC=84=A0=ED=83=9D=20=EB=AA=A8=EB=8B=AC=20?= =?UTF-8?q?=EB=82=A9=ED=92=88=EC=9D=BC=20=ED=8F=AC=EB=A7=B7=20=EB=B0=8F=20?= =?UTF-8?q?=EA=B0=9C=EC=86=8C=20=EC=88=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - delivery_date: ISO 타임스탬프 → Y-m-d 포맷으로 변환 - location_count: order_items 수 → order_nodes 루트 노드(개소) 수로 변경 Co-Authored-By: Claude Opus 4.6 --- app/Services/QualityDocumentService.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Services/QualityDocumentService.php b/app/Services/QualityDocumentService.php index 66af795..313ada7 100644 --- a/app/Services/QualityDocumentService.php +++ b/app/Services/QualityDocumentService.php @@ -347,8 +347,9 @@ public function availableOrders(array $params): array $query = Order::where('tenant_id', $tenantId) ->whereNotIn('id', $linkedOrderIds) - ->with(['items']) - ->withCount('items'); + ->withCount(['nodes as location_count' => function ($q) { + $q->whereNull('parent_id'); + }]); if ($q !== '') { $query->where(function ($qq) use ($q) { @@ -364,8 +365,8 @@ public function availableOrders(array $params): array 'id' => $order->id, 'order_number' => $order->order_no, 'site_name' => $order->site_name ?? '', - 'delivery_date' => $order->delivery_date ?? '', - 'location_count' => $order->items_count, + 'delivery_date' => $order->delivery_date?->format('Y-m-d') ?? '', + 'location_count' => $order->location_count, ]) ->toArray(); }