|
|
@@ -81,6 +81,7 @@ class RefundOrderService extends BaseService
|
|
|
if (empty($shop)) {
|
|
|
util::fail('没有找到门店');
|
|
|
}
|
|
|
+ //总支出增加
|
|
|
$currentTotalExpend = bcadd($shop->totalExpend, $refundPrice, 2);
|
|
|
$shop->totalExpend = $currentTotalExpend;
|
|
|
$shop->save();
|
|
|
@@ -88,7 +89,6 @@ class RefundOrderService extends BaseService
|
|
|
//支出流水
|
|
|
$thisType = dict::getDict('capitalType', 'saleRefund', 'id');
|
|
|
$sjId = $order->sjId ?? 0;
|
|
|
- $shopId = $order->shopId ?? 0;
|
|
|
$event = '销售退款';
|
|
|
$capitalData = [
|
|
|
'capitalType' => $thisType,
|
|
|
@@ -129,6 +129,10 @@ class RefundOrderService extends BaseService
|
|
|
}
|
|
|
$custom->debtAmount = $currentDebtAmount;
|
|
|
$custom->save();
|
|
|
+ if ($currentDebtAmount == 0) {
|
|
|
+ $shop->mayGatheringNum -= 1;
|
|
|
+ $shop->save();
|
|
|
+ }
|
|
|
|
|
|
} elseif ($payWay == dict::getDict('payWay', 'balancePay')) {
|
|
|
//门店余额减少
|