Browse Source

Merge branch 'master' of http://git.huaml.com/zhh/huahuibao

林琦海 5 years ago
parent
commit
9b6dc2dd9c
2 changed files with 21 additions and 1 deletions
  1. 20 0
      biz-ghs/order/classes/PurchaseOrderClass.php
  2. 1 1
      common/components/dict.php

+ 20 - 0
biz-ghs/order/classes/PurchaseOrderClass.php

@@ -74,6 +74,10 @@ class PurchaseOrderClass extends BaseClass
         $data['smallNum'] = $smallNum;
         $data['price'] = $totalItemPrice;
 
+        //包装重量 shish 20210614
+        $data['packWeight'] = isset($data['packWeight']) && is_numeric($data['packWeight']) ? $data['packWeight'] : 0;
+        $totalItemWeight = bcadd($totalItemWeight, $data['packWeight'], 2);
+
         //计算订单总价
         $data['packingCharge'] = empty($data['packingCharge']) ? 0 : $data['packingCharge'];
         $data['shortCharge'] = empty($data['shortCharge']) ? 0 : $data['shortCharge'];
@@ -94,9 +98,25 @@ class PurchaseOrderClass extends BaseClass
         $orderPrice = bcadd($orderPrice, $longCharge, 2);
         $orderPrice = bcadd($orderPrice, $pickCharge, 2);
         $orderPrice = bcadd($orderPrice, $localCharge, 2);
+
         $data['orderPrice'] = $orderPrice;
         $data['prePrice'] = $orderPrice;
+
+        if (isset($data['modifyPrice'])) {
+            //商家打折,修改金额
+            $modifyPrice = $data['modifyPrice'] ?? 0;
+            if ($modifyPrice > $orderPrice) {
+                util::fail('实收金额大于订单总金额');
+            }
+            if ($modifyPrice < $orderPrice) {
+                $data['discountAmount'] = bcsub($orderPrice, $modifyPrice, 2);
+                $data['discountType'] = dict::getDict('discountType', 'discount');
+                $orderPrice = $modifyPrice;
+            }
+        }
+        //实付款
         $data['actPrice'] = $orderPrice;
+        //实付款,扣除平台补贴
         $data['realPrice'] = $orderPrice;
 
         //总运费

+ 1 - 1
common/components/dict.php

@@ -89,7 +89,7 @@ class dict
             //使用平台优惠券
             'usePtCoupon' => 2,
             //商家打折
-            'discount'=>3,
+            'discount' => 3,
         ],
 
         'payStatus' => ['cancel' => -1, 'waitForPay' => 0, 'waitForSend' => 1],