|
|
@@ -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')) {
|