shish преди 2 години
родител
ревизия
0f246d9429
променени са 1 файла, в които са добавени 30 реда и са изтрити 0 реда
  1. 30 0
      app-ghs/controllers/OrderController.php

+ 30 - 0
app-ghs/controllers/OrderController.php

@@ -1228,6 +1228,36 @@ class OrderController extends BaseController
         $info = OrderService::getOrderInfo($id, true, true, true, false);
         OrderClass::valid($info, $this->shopId);
 
+        //A4打印需要用到的数据
+        $customId = $info['customId'] ?? 0;
+        $custom = CustomClass::getById($customId, true);
+        if (empty($custom)) {
+            util::fail('没有找到客户');
+        }
+        $customName = $custom->name ?? '';
+        $seatSn = $custom->seatSn ?? '';
+        $sendTimeWant = $info['sendTimeWant'] ?? '';
+        $shortSendTimeWant = !empty($sendTimeWant) ? substr($sendTimeWant, 5, 5) : '';
+        $table = [];
+        if (isset($info['product']) && !empty($info['product'])) {
+            foreach ($info['product'] as $key => $val) {
+                $currentName = $val['name'] ?? '';
+                $num = $val['xhNum'] ?? 0;
+                $unitName = $val['xhUnitName'] ?? '扎';
+                $table[] = [
+                    'name' => $currentName,
+                    'num' => $num . $unitName
+                ];
+            }
+        }
+        $a4Print = [
+            'customName' => $customName,
+            'seatSn' => $seatSn,
+            'shortSendTimeWant' => $shortSendTimeWant,
+            'table' => $table,
+        ];
+        $info['printData'] = $a4Print;
+
         //是否有云打印判断
         $hasCloudPrint = 0;
         $shopExt = $this->shopExt;