|
|
@@ -3,6 +3,7 @@
|
|
|
namespace bizHd\refund\classes;
|
|
|
|
|
|
use biz\shop\classes\ShopExtClass;
|
|
|
+use bizHd\shop\classes\MainClass;
|
|
|
use common\components\noticeUtil;
|
|
|
use common\components\orderSn;
|
|
|
use Yii;
|
|
|
@@ -40,7 +41,7 @@ class HdRefundClass extends BaseClass
|
|
|
$refundReason = '';
|
|
|
$orderSn = '';
|
|
|
$thirdNo = $order->thirdNo ?? '';
|
|
|
- //竟然会出现thirdNo为空的情况,好像客户付款时有优惠金额时
|
|
|
+ //竟然会出现thirdNo为空的情况,好像客户付款时有优惠金额时
|
|
|
if (empty($thirdNo)) {
|
|
|
$orderSn = $order->orderSn ?? '';
|
|
|
}
|
|
|
@@ -55,15 +56,20 @@ class HdRefundClass extends BaseClass
|
|
|
if (!isset($response['code']) || $response['code'] != 'BBS00000') {
|
|
|
$errMsg = $response['msg'] ?? '';
|
|
|
noticeUtil::push("钱没有退回 {$xsOrderSn} {$errMsg}", '15280215347');
|
|
|
- return ['status' => 0, 'msg' => $errMsg];
|
|
|
+ return ['status' => 0, 'msg' => $errMsg, 'shopId' => 0];
|
|
|
} else {
|
|
|
+
|
|
|
$shopId = $shop->id;
|
|
|
- ShopExtClass::orderCancelBackMoneyReport($shopId);
|
|
|
+ $mainId = $shop->mainId;
|
|
|
+ $main = MainClass::getLockById($mainId);
|
|
|
+ $refund = ['id' => 0, 'refundSn' => $refundSn, 'orderSn' => ''];
|
|
|
+ \biz\shop\classes\ShopClass::hdSaleRefundReduceBalance($main, $shop, $refund, $refundPrice);
|
|
|
+
|
|
|
$sjName = $shop->merchantName;
|
|
|
$shopName = $shop->shopName;
|
|
|
$name = $shopName == '首店' ? $sjName : $sjName . '-' . $shopName;
|
|
|
noticeUtil::push("钱已经原路退回 success {$xsOrderSn} {$name}", '15280215347');
|
|
|
- return ['status' => 1, 'msg' => '退款成功'];
|
|
|
+ return ['status' => 1, 'msg' => '退款成功', 'shopId' => $shopId];
|
|
|
}
|
|
|
}
|
|
|
|