Browse Source

设置默认收花人

shish 7 months ago
parent
commit
21355172c4
1 changed files with 17 additions and 0 deletions
  1. 17 0
      biz-hd/order/services/OrderService.php

+ 17 - 0
biz-hd/order/services/OrderService.php

@@ -62,6 +62,23 @@ class OrderService extends BaseService
         if (empty($data['bookName'])) {
             $data['bookName'] = $custom->name;
         }
+        //如果开单没有传收花人信息,则使用订花人的信息
+        if (empty($data['receiveUserName'])) {
+            $data['receiveUserName'] = $custom->name;
+        }
+        if (empty($data['receiveMobile'])) {
+            $data['receiveMobile'] = $custom->mobile;
+        }
+        if (empty($data['address'])) {
+            $data['address'] = $custom->address;
+            $data['province'] = $custom->province;
+            $data['city'] = $custom->city;
+            $data['floor'] = $custom->floor;
+            $data['fullAddress'] = $custom->fullAddress;
+            $data['showAddress'] = $custom->showAddress;
+            $data['long'] = $custom->long;
+            $data['lat'] = $custom->lat;
+        }
 
         $currentGoodsIds = [];
         $currentItemIds = [];