|
|
|
@ -776,23 +776,23 @@ class OrderService implements OrderServiceInterface |
|
|
|
|
|
|
|
if($orderMain->pay_type == OrderMain::ORDER_PAY_WX){ |
|
|
|
// 微信支付 微信退款
|
|
|
|
if($this->wxRefundService->wxPayRefund($global_order_id)){ |
|
|
|
if(!$this->wxRefundService->wxPayRefund($global_order_id)){ |
|
|
|
Db::rollBack(); |
|
|
|
return false; |
|
|
|
}; |
|
|
|
}else if($orderMain->pay_type == OrderMain::ORDER_PAY_BALANCE){ |
|
|
|
// 余额支付 退款到用户余额
|
|
|
|
if($this->userService->userWallet($orderMain->user_id,$orderMain->money,Users::WALLET_TYPE_INC)){ |
|
|
|
Db::rollBack(); |
|
|
|
return false; |
|
|
|
}; |
|
|
|
// if($this->userService->userWallet($orderMain->user_id,$orderMain->money,Users::WALLET_TYPE_INC)){
|
|
|
|
// Db::rollBack();
|
|
|
|
// return false;
|
|
|
|
// };
|
|
|
|
|
|
|
|
// 返还优惠券
|
|
|
|
$this->couponService->orderRefundCoupon($global_order_id); |
|
|
|
// $this->couponService->orderRefundCoupon($global_order_id);
|
|
|
|
// 删除特价商品缓存
|
|
|
|
$this->orderService->clearTodayGoodPurchase($orderMain->user_id,1); |
|
|
|
// $this->orderService->clearTodayGoodPurchase($orderMain->user_id,1);
|
|
|
|
// 添加用户流水
|
|
|
|
$this->financialService->userByOLOrderRefund($orderMain->user_id, $orderMain->global_order_id, $orderMain->money); |
|
|
|
// $this->financialService->userByOLOrderRefund($orderMain->user_id, $orderMain->global_order_id, $orderMain->money);
|
|
|
|
} |
|
|
|
|
|
|
|
Db::commit(); |
|
|
|
@ -855,6 +855,6 @@ class OrderService implements OrderServiceInterface |
|
|
|
public function clearTodayGoodPurchase($userId, $goodId) |
|
|
|
{ |
|
|
|
$ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); |
|
|
|
return $ssdb->exec('hdel', SsdbKeysPrefix::PURCHASE_RECORD. date('Ymd') .'_'.$userId, $goodId); |
|
|
|
return $ssdb->exec('del', SsdbKeysPrefix::PURCHASE_RECORD. date('Ymd') .'_'.$userId, $goodId); |
|
|
|
} |
|
|
|
} |