Parcourir la source

退款金额有问题

shish il y a 4 ans
Parent
commit
07ca319e7b
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      biz-hd/refund/services/HdRefundService.php

+ 5 - 0
biz-hd/refund/services/HdRefundService.php

@@ -41,11 +41,16 @@ class HdRefundService extends BaseService
         $order->tkPrice = $currentTkPrice;
         $order->refund = OrderClass::REFUND_YES;
         $currentActPrice = bcsub($order->actPrice, $refundPrice, 2);
+        $currentMainPay = bcsub($order->mainPay, $refundPrice, 2);
         if ($currentActPrice < 0) {
             util::fail('退款金额有问题!');
         }
+        if ($currentMainPay < 0) {
+            util::fail('退款金额有问题哦');
+        }
         $order->actPrice = $currentActPrice;
         $order->realPrice = $currentActPrice;
+        $order->mainPay = $currentMainPay;
         $order->save();
 
         $transaction_id = $order->thirdNo ?? '';