quguofeng 1 年之前
父节点
当前提交
03ddd7ce17

+ 3 - 0
app/common/repositories/store/order/StoreRefundOrderRepository.php

@@ -282,6 +282,9 @@ class StoreRefundOrderRepository extends BaseRepository
             if ($product['product_price'] > 0) {
                 $refundPrice = bcsub($product['product_price'], bcsub($productRefundPrice['refund_price'] ?? 0, $productRefundPrice['refund_postage'] ?? 0, 2), 2);
             }
+            if($order->is_percentage == 1){   //百分比支付
+                $refundPrice -= $refundPrice * ($order->discounts_percentage + ($order->start_percentage - $order->residue_percentage))/100;
+            }
             $platform_refund_price = 0;
             //计算退的平台优惠券金额
             if ($product['platform_coupon_price'] > 0) {

+ 3 - 3
app/controller/api/store/order/StoreRefundOrder.php

@@ -132,10 +132,10 @@ class StoreRefundOrder extends BaseController
         if ($order->status < 0) return app('json')->fail('订单已退款');
         if ($order->status == 10) return app('json')->fail('订单不支持退款');
         if($order->is_virtual && $data['refund_type'] == 2) return app('json')->fail('订单不支持退款退货');
-        if($order->is_percentage == 1){
-            $data['refund_price'] = $order->pay_price;
-        }
         if ($type == 2) {
+            if($order->is_percentage == 1){
+                $data['refund_price'] = $order->pay_price;
+            }
             $refund = $this->repository->refund($order, (int)$ids[0], $num, $uid, $data);
         } else {
             $refund = $this->repository->refunds($order, $ids, $uid, $data);