Browse Source

制作单

shish 4 năm trước cách đây
mục cha
commit
27c1c2d667

+ 4 - 2
app-mall/controllers/OrderController.php

@@ -115,7 +115,8 @@ class OrderController extends BaseController
             $post['sendCost'] = $sendCost;
             $post['sjId'] = $this->sjId;
             $post['shopId'] = $this->shopId;
-            $post['mainId'] = $this->mainId;
+            $mainId = $this->mainId;
+            $post['mainId'] = $mainId;
             //计算总金额
             $unitPrice = $goodsInfo['price'];
             $goodsStyleList = isset($goodsInfo['goodsStyleList']) ? $goodsInfo['goodsStyleList'] : [];
@@ -154,7 +155,7 @@ class OrderController extends BaseController
             $post['orderPrice'] = $actPrice;
             $post['actPrice'] = $actPrice;
             $post['realPrice'] = $actPrice;
-            $post['mainId'] = $this->mainId;
+            $post['mainId'] = $mainId;
             $post['needPrint'] = dict::getDict('needPrint', 'need');
             $order = OrderClass::addOrder($post);
             $orderId = $order['id'];
@@ -165,6 +166,7 @@ class OrderController extends BaseController
                 'goodsId' => $goodsId,
                 'userId' => $this->userId,
                 'sjId' => $this->sjId,
+                'mainId' => $mainId,
                 'name' => $goodsInfo['name'] ?? '',
                 'cover' => $currentCover,
                 'unitPrice' => $unitPrice,

+ 1 - 1
biz-hd/goods/classes/GoodsClass.php

@@ -496,7 +496,7 @@ class GoodsClass extends BaseClass
             $orderSn = $params['orderSn'] ?? '';
             $orderId = $params['orderId'] ?? 0;
             $params = [
-                'goods' => ['productId' => $goodsId, 'num' => abs($newStock)],
+                'goods' => [['productId' => $goodsId, 'num' => abs($newStock)]],
                 'remark' => '',
                 'sjId' => $sjId,
                 'mainId' => $mainId,