|
|
@@ -303,9 +303,16 @@ class HdRefundService extends BaseService
|
|
|
CustomClass::refundDebtAmountReduce($custom, $refundPrice, $refund);
|
|
|
|
|
|
} else {
|
|
|
- //有订金的订单,部分欠款的订单,暂不支持退款
|
|
|
+ //部分欠款的订单,付了订金的订单
|
|
|
if ($order->remainDebtPrice > 0) {
|
|
|
- util::fail('部分欠款订单暂不支持退货退款');
|
|
|
+ if ($refundPrice > $order->remainDebtPrice) {
|
|
|
+ $order->remainDebtPrice = 0;
|
|
|
+ $order->save();
|
|
|
+ } else {
|
|
|
+ $currentRemain = bcsub($order->remainDebtPrice, $refundPrice, 2);
|
|
|
+ $order->remainDebtPrice = $currentRemain;
|
|
|
+ $order->save();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if ($payWay == dict::getDict('payWay', 'cash')) {
|