Browse Source

custom 数据的特殊处理与传递

shizhongqi 1 tuần trước cách đây
mục cha
commit
e39a39398a
1 tập tin đã thay đổi với 5 bổ sung2 xóa
  1. 5 2
      app-mall/controllers/GroupBuyController.php

+ 5 - 2
app-mall/controllers/GroupBuyController.php

@@ -231,7 +231,7 @@ class GroupBuyController extends BaseController
             if ($goodsNum > intval($row['limit'] ?? 1)) {
                 util::fail('超出单人限购数量');
             }
-            $order = $this->createGroupBuyOrder($form, $row, $groupBuyId, $goodsNum);
+            $order = $this->createGroupBuyOrder($form, $row, $groupBuyId, $goodsNum, $custom);
             GroupBuyMemberClass::bindOrderMember(
                 $groupBuyId,
                 $mainId,
@@ -282,7 +282,7 @@ class GroupBuyController extends BaseController
      * @param int $goodsNum
      * @return object
      */
-    private function createGroupBuyOrder($form, $row, $groupBuyId, $goodsNum)
+    private function createGroupBuyOrder($form, $row, $groupBuyId, $goodsNum, $currenCustom = [])
     {
         $shop = $this->shop;
         $openShop = ShopClass::getOpenShop($shop);
@@ -291,6 +291,9 @@ class GroupBuyController extends BaseController
         }
         $mainId = intval($this->mainId);
         $custom = $this->custom;
+        if (empty($custom) && !empty($currenCustom)) {
+            $custom = $currenCustom;
+        }
         $hd = $this->hd;
         $user = $this->user;
         $saleGoodsId = intval($row['goodsId']);