shish 3 tahun lalu
induk
melakukan
ad9393a46f
1 mengubah file dengan 11 tambahan dan 10 penghapusan
  1. 11 10
      biz-hd/order/services/OrderService.php

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

@@ -272,20 +272,21 @@ class OrderService extends BaseService
             $data['mainPay'] = $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;
-        }
         if ($hasPay == dict::getDict('hasPay', 'debt')) {
             $data['debtPrice'] = $modifyPrice;
             $data['remainDebtPrice'] = $modifyPrice;
             $data['debt'] = 1;
+        } else {
+            //如果有订金
+            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;