|
|
@@ -275,6 +275,20 @@ class CgRefundService extends BaseService
|
|
|
|
|
|
//门店余额增加
|
|
|
ShopClass::cgRefundAddBalance($main, $shop, $refundPrice, $cgRefund, $ghs);
|
|
|
+
|
|
|
+ } elseif ($payWay == dict::getDict('payWay', 'cash')) {
|
|
|
+ $cg->refundPrice = $refundPrice;
|
|
|
+ $currentActPrice = bcsub($cg->actPrice, $refundPrice, 2);
|
|
|
+ if ($currentActPrice < 0) {
|
|
|
+ util::fail('可退款金额不足...');
|
|
|
+ }
|
|
|
+ $cg->actPrice = $currentActPrice;
|
|
|
+ $currentRealPrice = bcsub($cg->realPrice, $refundPrice, 2);
|
|
|
+ if ($currentRealPrice < 0) {
|
|
|
+ util::fail('可退款金额不足,请确认');
|
|
|
+ }
|
|
|
+ $cg->realPrice = $currentRealPrice;
|
|
|
+ $cg->save();
|
|
|
} else {
|
|
|
//其它线下退款直接完成
|
|
|
$cg->refundPrice = $refundPrice;
|