|
|
@ -197,6 +197,15 @@ class NotifyController extends BaseController |
|
|
|
|
|
|
|
|
// 公众号模板消息
|
|
|
// 公众号模板消息
|
|
|
$res = $this->miniprogramService->sendTemMsgForOnlineOrder($orderMain->global_order_id); |
|
|
$res = $this->miniprogramService->sendTemMsgForOnlineOrder($orderMain->global_order_id); |
|
|
|
|
|
|
|
|
|
|
|
co(function () use ($orderMain) { |
|
|
|
|
|
$openid = User::query()->where(['id' => $orderMain->user_id])->value('openid'); |
|
|
|
|
|
$unionid = $this->userInfoService->getPaidUnionId($openid, ['mch_id' => config('wxpay.mch_id'), 'out_trade_no' => $orderMain->global_order_id]); |
|
|
|
|
|
if ($unionid) { |
|
|
|
|
|
User::query()->where(['id' => $orderMain->user_id, 'openid' => $openid])->update(['unionid' => $unionid]); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
return true; |
|
|
return true; |
|
|
|
|
|
|
|
|
} catch (Exception $e) { |
|
|
} catch (Exception $e) { |
|
|
@ -285,9 +294,13 @@ class NotifyController extends BaseController |
|
|
// 公众号模板消息
|
|
|
// 公众号模板消息
|
|
|
$res = $this->miniprogramService->sendTemMsgForOfflineOrder($orderMain->global_order_id); |
|
|
$res = $this->miniprogramService->sendTemMsgForOfflineOrder($orderMain->global_order_id); |
|
|
|
|
|
|
|
|
$openid = User::query()->where(['id' => $orderMain->user_id])->value('openid'); |
|
|
|
|
|
$res = $this->userInfoService->getPaidUnionId($openid); |
|
|
|
|
|
$this->log->event('test_get_paid_unionid', ['res' => $res]); |
|
|
|
|
|
|
|
|
co(function () use ($orderMain) { |
|
|
|
|
|
$openid = User::query()->where(['id' => $orderMain->user_id])->value('openid'); |
|
|
|
|
|
$unionid = $this->userInfoService->getPaidUnionId($openid, ['mch_id' => config('wxpay.mch_id'), 'out_trade_no' => $orderMain->global_order_id]); |
|
|
|
|
|
if ($unionid) { |
|
|
|
|
|
User::query()->where(['id' => $orderMain->user_id, 'openid' => $openid])->update(['unionid' => $unionid]); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
return true; |
|
|
return true; |
|
|
|
|
|
|
|
|
|