|
|
|
@ -6,19 +6,11 @@ use App\Constants\LogLabel; |
|
|
|
|
|
|
|
use App\Model\OrderMain; |
|
|
|
|
|
|
|
use App\Model\Users; |
|
|
|
use App\Service\CouponRebateServiceInterface; |
|
|
|
use App\Service\DeviceServiceInterface; |
|
|
|
use App\Service\FeiePrintServiceInterface; |
|
|
|
use App\Service\MiniprogramServiceInterface; |
|
|
|
use App\Service\MqttServiceInterface; |
|
|
|
|
|
|
|
use App\Service\OrderServiceInterface; |
|
|
|
use App\Service\SeparateAccountsServiceInterface; |
|
|
|
use App\Service\UserServiceInterface; |
|
|
|
use App\Service\FinancialRecordServiceInterface; |
|
|
|
use EasyWeChat\Factory; |
|
|
|
use Hyperf\DbConnection\Db; |
|
|
|
use Hyperf\Guzzle\CoroutineHandler; |
|
|
|
use Exception; |
|
|
|
use Hyperf\Di\Annotation\Inject; |
|
|
|
use Hyperf\HttpMessage\Stream\SwooleStream; |
|
|
|
use Symfony\Component\HttpFoundation\Request; |
|
|
|
@ -30,15 +22,9 @@ class NotifyPayRefundController extends BaseController |
|
|
|
|
|
|
|
/** |
|
|
|
* @Inject |
|
|
|
* @var UserServiceInterface |
|
|
|
*/ |
|
|
|
protected $userService; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Inject |
|
|
|
* @var CouponRebateServiceInterface |
|
|
|
* @var FinancialRecordServiceInterface |
|
|
|
*/ |
|
|
|
protected $couponRebateService; |
|
|
|
protected $financialService; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Inject |
|
|
|
@ -86,10 +72,14 @@ class NotifyPayRefundController extends BaseController |
|
|
|
// 退款返还优惠券
|
|
|
|
$this->couponService->orderRefundCoupon($message['out_trade_no']); |
|
|
|
// 添加用户的流水
|
|
|
|
$orderMain = OrderMain::select('id','global_order_id')->where('code',$message['out_trade_no'])->first(); |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception $e) { |
|
|
|
$orderMain = OrderMain::select('id','global_order_id','money','user_id') |
|
|
|
->where('global_order_id',$message['out_trade_no']) |
|
|
|
->where('state',OrderMain::ORDER_STATE_REFUNDED) |
|
|
|
->first(); |
|
|
|
if(!empty($orderMain)){ |
|
|
|
$this->financialService->userByOLOrderRefund($orderMain->user_id, $orderMain->global_order_id, $orderMain->money); |
|
|
|
} |
|
|
|
} catch (\Exception $e) { |
|
|
|
|
|
|
|
$this->log->event( |
|
|
|
LogLabel::PAY_NOTIFY_REFUND, |
|
|
|
|