|
@@ -128,12 +128,24 @@ class WxOpenController extends PublicController
|
|
|
if (isset($open['merchantId']) && empty($open['merchantId'])) {
|
|
if (isset($open['merchantId']) && empty($open['merchantId'])) {
|
|
|
WxOpenService::updateById(1, ['merchantId' => $id]);
|
|
WxOpenService::updateById(1, ['merchantId' => $id]);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
$merchant = MerchantService::getMerchantById($id);
|
|
$merchant = MerchantService::getMerchantById($id);
|
|
|
- if (!empty($merchant['wxAppId']) && $merchant['wxAppId'] != $authorizeAppId) {
|
|
|
|
|
- util::stop('授权的公众号与商家不对应');
|
|
|
|
|
|
|
+ if (isset($merchant['wxAppId']) && !empty($merchant['wxAppId'])) {
|
|
|
|
|
+ if (isset($authorize_info['MiniProgramInfo']) == false || empty($authorize_info['MiniProgramInfo'])) {
|
|
|
|
|
+ if ($merchant['wxAppId'] != $authorizeAppId) {
|
|
|
|
|
+ util::stop('授权的公众号与商家已绑定的公众号不一致');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (isset($merchant['miniAppId']) && !empty($merchant['miniAppId'])) {
|
|
|
|
|
+ if (isset($authorize_info['MiniProgramInfo']) && !empty($authorize_info['MiniProgramInfo'])) {
|
|
|
|
|
+ if ($merchant['miniAppId'] != $authorizeAppId) {
|
|
|
|
|
+ util::stop('授权的小程序与商家已绑定的小程序不一致');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//小程序
|
|
//小程序
|
|
|
if (isset($authorize_info['MiniProgramInfo']) && !empty($authorize_info['MiniProgramInfo'])) {
|
|
if (isset($authorize_info['MiniProgramInfo']) && !empty($authorize_info['MiniProgramInfo'])) {
|
|
|
xhMerchantExtendService::updateByMerchantId($id, ['miniAppId' => $authorizeAppId, 'miniAccessToken' => $authorize_access_token, 'miniAccessTokenTime' => $accessTokenTime, 'miniRefreshToken' => $authorize_refresh_token]);
|
|
xhMerchantExtendService::updateByMerchantId($id, ['miniAppId' => $authorizeAppId, 'miniAccessToken' => $authorize_access_token, 'miniAccessTokenTime' => $accessTokenTime, 'miniRefreshToken' => $authorize_refresh_token]);
|