|
|
@@ -38,19 +38,17 @@ class HdRefundService extends BaseService
|
|
|
//记录总的退款金额
|
|
|
$order->refundPrice = $refundPrice;
|
|
|
$currentTkPrice = bcadd($order->tkPrice, $refundPrice, 2);
|
|
|
+ if ($currentTkPrice > $order->mainPay) {
|
|
|
+ util::fail('退款金额超过在线支付金额');
|
|
|
+ }
|
|
|
$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 ?? '';
|