Эх сурвалжийг харах

Merge branch 'mt' of git.huaml.com:zhh/huahuibao into mt

shizhongqi 4 жил өмнө
parent
commit
a604b23808

+ 10 - 0
biz-hd/order/services/OrderService.php

@@ -248,6 +248,16 @@ class OrderService extends BaseService
         $data['goodsPrice'] = $goodsPrice;
         $data['prePrice'] = $totalPrice;
         $data['orderPrice'] = $modifyPrice;
+        //如果有订金
+        if (isset($data['dj']) && $data['dj'] > 0) {
+            if ($data['dj'] >= $modifyPrice) {
+                util::fail('订金要小于总金额');
+            }
+            $currentDebt = bcsub($modifyPrice, $data['dj'], 2);
+            $data['debtPrice'] = $currentDebt;
+            $data['remainDebtPrice'] = $currentDebt;
+            $data['debt'] = 1;
+        }
         $data['actPrice'] = $modifyPrice;
         $data['realPrice'] = $modifyPrice;
         $data['customId'] = $customId;