shish 1 year ago
parent
commit
e3ecfecf6c
1 changed files with 10 additions and 7 deletions
  1. 10 7
      app-ghs/controllers/LiveOrderController.php

+ 10 - 7
app-ghs/controllers/LiveOrderController.php

@@ -215,21 +215,24 @@ class LiveOrderController extends BaseController
             util::fail('不是你的');
         }
         $orderSn = $live->orderSn ?? '';
-        $customList = LiveOrderCustomClass::getAllByCondition(['orderSn' => $orderSn], null, '*', null, true);
+        $liveCustomList = LiveOrderCustomClass::getAllByCondition(['orderSn' => $orderSn], null, '*');
         if (empty($customList)) {
             util::fail('没有客户预订');
         }
+        $ids = array_column($liveCustomList, 'customId');
+        $customList = CustomClass::getAllByCondition(['id' => ['in', $ids]], null, '*', 'id');
         $table = [];
-        foreach ($customList as $custom) {
-            $currentName = $custom->customName ?? '';
-            $num = $custom->num ?? '';
+        foreach ($liveCustomList as $liveCustom) {
+            $customId = $liveCustom['customId'] ?? 0;
+            $currentName = $liveCustom['customName'] ?? '';
+            $num = $liveCustom['num'] ?? '';
+            $customInfo = $customList[$customId] ?? [];
+            $seatSn = $customInfo['seatSn'] ?? '';
             $table[] = [
                 'name' => $currentName,
                 'num' => $num,
-                'confirmNum' => '',
+                'seatSn' => $seatSn,
                 'remark' => '',
-                'unitPrice' => '',
-                'price' => '',
             ];
         }
         $a4Print = [