shish 5 anni fa
parent
commit
6f19e5799a
1 ha cambiato i file con 15 aggiunte e 0 eliminazioni
  1. 15 0
      biz-ghs/order/services/RefundOrderService.php

+ 15 - 0
biz-ghs/order/services/RefundOrderService.php

@@ -113,6 +113,21 @@ class RefundOrderService extends BaseService
         $order->save();
 
         if ($payWay == dict::getDict('payWay', 'wxPay')) {
+
+            $currentRefund = bcadd($order->refundPrice, $refundPrice, 2);
+            $order->refundPrice = $currentRefund;
+            $currentActPrice = bcsub($order->actPrice, $refundPrice, 2);
+            if ($currentActPrice < 0) {
+                util::fail('退款金额有问题!');
+            }
+            $order->actPrice = $currentActPrice;
+            $currentRealPrice = bcsub($order->realPrice, $refundPrice, 2);
+            if ($currentRealPrice < 0) {
+                util::fail('退款金额有问题');
+            }
+            $order->realPrice = $currentRealPrice;
+            $order->save();
+
             //门店余额减少
             ShopClass::saleRefundReduceBalance($shop, $refund, $refundPrice);
         } elseif ($payWay == dict::getDict('payWay', 'debtPay')) {