Browse Source

客户结账下单

shish 4 năm trước cách đây
mục cha
commit
c3dd29f415
1 tập tin đã thay đổi với 9 bổ sung2 xóa
  1. 9 2
      biz-hd/purchase/classes/PurchaseClearClass.php

+ 9 - 2
biz-hd/purchase/classes/PurchaseClearClass.php

@@ -33,6 +33,11 @@ class PurchaseClearClass extends BaseClass
             util::fail('没有找到客户');
         }
 
+        $ghsShopId = $ghs->shopId ?? 0;
+        $ghsShop = ShopClass::getById($ghsShopId, true);
+        $ghsShopName = $ghsShop->shopName ?? '';
+        $ghsShopName = $ghsShopName == '首店' ? '总店' : $ghsShopName;
+
         $orderSn = orderSn::getPurchaseClearSn();
         $purchaseIds = $data['purchaseIds'];
         $arr = explode(',', $purchaseIds);
@@ -70,7 +75,7 @@ class PurchaseClearClass extends BaseClass
         $validTime = dict::getDict('order_pay_has_time');
         $deadTime = time() + $validTime;
         $data['deadline'] = date("Y-m-d H:i:s", $deadTime);
-        $arr = [
+        $params = [
             'ghsId' => $ghsId,
             'ghsName' => $ghs['name'] ?? '',
             'ghsMobile' => $ghs['mobile'] ?? '',
@@ -81,8 +86,10 @@ class PurchaseClearClass extends BaseClass
             'customAvatar' => $custom['avatar'] ?? '',
             'customMobile' => $custom['mobile'] ?? '',
             'customAddress' => $custom['address'] ?? '',
+            'num' => count($arr),
+            'ghsShopName' => $ghsShopName,
         ];
-        $data = array_merge($data, $arr);
+        $data = array_merge($data, $params);
         return self::add($data);
     }