소스 검색

预订单优化

shish 2 년 전
부모
커밋
953b81652d

+ 3 - 1
biz-ghs/order/classes/OrderClass.php

@@ -485,7 +485,9 @@ class OrderClass extends BaseClass
             $product = \bizHd\product\classes\ProductClass::hdToggleGhs($product, $shop);
         }
 
-        $respond = OrderItemClass::replaceItem($orderSn, $product, $data, $stockMayChange);
+        $customShopAdminId = $data['customShopAdminId'] ?? 0;
+        $moreParams = ['book' => $book, 'customShopAdminId' => $customShopAdminId];
+        $respond = OrderItemClass::replaceItem($orderSn, $product, $data, $stockMayChange, $moreParams);
 
         $sendCost = isset($data['sendCost']) && is_numeric($data['sendCost']) ? $data['sendCost'] : 0;
         $data['sendCost'] = $sendCost;

+ 2 - 2
biz-ghs/order/classes/OrderItemClass.php

@@ -117,13 +117,13 @@ class OrderItemClass extends BaseClass
     }
 
     //添加修改花材 ssh 2021.1.22
-    public static function replaceItem($orderSn, $product, $post = null, $stockMayChange = false)
+    public static function replaceItem($orderSn, $product, $post = null, $stockMayChange = false, $moreParams = [])
     {
         $customId = $post['customId'] ?? 0;
         $custom = CustomClass::getById($customId, true);
         $level = $custom->level ?? 0;
         $live = isset($custom->live) ? $custom->live : 1;
-        $respond = ProductClass::formatProductInfo($product, $level, $live);
+        $respond = ProductClass::formatProductInfo($product, $level, $live, $moreParams);
         $product = $respond['product'];
         $weight = 0;
         $mainId = $post['mainId'] ?? 0;

+ 11 - 3
biz-ghs/product/classes/ProductClass.php

@@ -1170,7 +1170,7 @@ class ProductClass extends BaseClass
     }
 
     //下单时计算商品的价格  lqh 2021.1.28
-    public static function formatProductInfo($itemInfo, $level = 0, $live = 1)
+    public static function formatProductInfo($itemInfo, $level = 0, $live = 1, $moreParams = [])
     {
         $data = [];
         if (empty($itemInfo)) {
@@ -1188,6 +1188,9 @@ class ProductClass extends BaseClass
             $hdProductData = ProductClass::getByIds($hdIds, null, 'id');
         }
 
+        $book = $moreParams['book'] ?? 0;
+        $customShopAdminId = $moreParams['customShopAdminId'] ?? 0;
+
         $totalPrice = 0;
         $totalBigNum = 0;
         $totalSmallNum = 0;
@@ -1219,8 +1222,13 @@ class ProductClass extends BaseClass
             if ($live == 1) {
                 //供货商开单可以传单价过来
                 $changePrice = isset($v['price']) && $v['price'] > 0 ? $v['price'] : 0;
-                //今日特价、会员价
-                $itemPrice = self::getFinalPrice($currentGhsProduct, $level, $priceMap, $addPriceMap, $changePrice, $itemNum);
+                //如果零售店自己下预订单,预付0.1元,有二个地方要同步修改,搜索关键词 pre0.1
+                if ($book == 1 && $customShopAdminId > 0) {
+                    $itemPrice = 0.1;
+                } else {
+                    //今日特价、会员价
+                    $itemPrice = self::getFinalPrice($currentGhsProduct, $level, $priceMap, $addPriceMap, $changePrice, $itemNum);
+                }
                 $thisPrice = $itemPrice;
 
                 $reachNum = $currentGhsProduct['reachNum'] ?? 0;

+ 1 - 1
biz-hd/purchase/classes/PurchaseClass.php

@@ -636,7 +636,7 @@ class PurchaseClass extends BaseClass
                 //用批发店的花材名称
                 $itemName = $currentGhsProduct['name'] ?? '';
                 $cover = $currentGhsProduct['cover'] ?? '';
-                //如果零售店自己下预订单,预付0.1元
+                //如果零售店自己下预订单,预付0.1元,有二个地方要同步修改,搜索关键词 pre0.1
                 if ($book == 1 && $shopAdminId > 0) {
                     $price = 0.1;
                 } else {