|
|
@ -14,6 +14,7 @@ use Hyperf\Guzzle\CoroutineHandler; |
|
|
use Hyperf\Di\Annotation\Inject; |
|
|
use Hyperf\Di\Annotation\Inject; |
|
|
use Hyperf\HttpMessage\Stream\SwooleStream; |
|
|
use Hyperf\HttpMessage\Stream\SwooleStream; |
|
|
use Symfony\Component\HttpFoundation\Request; |
|
|
use Symfony\Component\HttpFoundation\Request; |
|
|
|
|
|
use App\Service\PurchaseLimitServiceInterface; |
|
|
|
|
|
|
|
|
class NotifyPayRefundController extends BaseController |
|
|
class NotifyPayRefundController extends BaseController |
|
|
{ |
|
|
{ |
|
|
@ -32,6 +33,12 @@ class NotifyPayRefundController extends BaseController |
|
|
*/ |
|
|
*/ |
|
|
protected $orderService; |
|
|
protected $orderService; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @Inject |
|
|
|
|
|
* @var PurchaseLimitServiceInterface |
|
|
|
|
|
*/ |
|
|
|
|
|
protected $purchaseLimitService; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 微信退款回调 |
|
|
* 微信退款回调 |
|
|
*/ |
|
|
*/ |
|
|
@ -73,12 +80,12 @@ class NotifyPayRefundController extends BaseController |
|
|
->where('global_order_id',$message['out_trade_no']) |
|
|
->where('global_order_id',$message['out_trade_no']) |
|
|
->where('state',OrderMain::ORDER_STATE_REFUNDED) |
|
|
->where('state',OrderMain::ORDER_STATE_REFUNDED) |
|
|
->first(); |
|
|
->first(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 退款返还优惠券
|
|
|
// 退款返还优惠券
|
|
|
$this->couponService->orderRefundCoupon($message['out_trade_no']); |
|
|
$this->couponService->orderRefundCoupon($message['out_trade_no']); |
|
|
|
|
|
|
|
|
// 删除特价商品缓存
|
|
|
// 删除特价商品缓存
|
|
|
$this->orderService->clearTodayGoodPurchase($orderMain->user_id,1); |
|
|
|
|
|
|
|
|
$this->purchaseLimitService->delSsdbPurchaseRecord($orderMain->id); |
|
|
|
|
|
|
|
|
// 添加用户的流水
|
|
|
// 添加用户的流水
|
|
|
if(!empty($orderMain)){ |
|
|
if(!empty($orderMain)){ |
|
|
@ -94,9 +101,9 @@ class NotifyPayRefundController extends BaseController |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
return $this->response |
|
|
|
|
|
->withHeader('Content-Type', 'text/xml') |
|
|
|
|
|
->withStatus(200) |
|
|
|
|
|
->withBody(new SwooleStream($response->getContent())); |
|
|
|
|
|
|
|
|
// return $this->response
|
|
|
|
|
|
// ->withHeader('Content-Type', 'text/xml')
|
|
|
|
|
|
// ->withStatus(200)
|
|
|
|
|
|
// ->withBody(new SwooleStream($response->getContent()));
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |