|
@@ -129,23 +129,24 @@ class WxOpenController extends PublicController
|
|
|
WxOpenService::updateById(1, ['merchantId' => $id]);
|
|
WxOpenService::updateById(1, ['merchantId' => $id]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $merchant = MerchantService::getMerchantById($id);
|
|
|
|
|
- if (isset($merchant['wxAppId']) && !empty($merchant['wxAppId'])) {
|
|
|
|
|
- if (isset($authorize_info['MiniProgramInfo']) == false || empty($authorize_info['MiniProgramInfo'])) {
|
|
|
|
|
- if ($merchant['wxAppId'] != $authorizeAppId) {
|
|
|
|
|
- util::stop('授权的公众号与商家已绑定的公众号不一致');
|
|
|
|
|
|
|
+ $extend = MerchantExtendClass::getByMerchantId($id);
|
|
|
|
|
+
|
|
|
|
|
+ if (isset($authorize_info['MiniProgramInfo']) && !empty($authorize_info['MiniProgramInfo'])) {
|
|
|
|
|
+ if (isset($extend['miniAppId']) && !empty($extend['miniAppId'])) {
|
|
|
|
|
+ if ($extend['miniAppId'] != $authorizeAppId) {
|
|
|
|
|
+ util::stop('授权的小程序与商家已绑定的小程序不一致');
|
|
|
}
|
|
}
|
|
|
|
|
+ }else{
|
|
|
|
|
+ util::stop('数据库请先填写小程序 miniAppId miniAppSecret');
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (isset($merchant['miniAppId']) && !empty($merchant['miniAppId'])) {
|
|
|
|
|
- if (isset($authorize_info['MiniProgramInfo']) && !empty($authorize_info['MiniProgramInfo'])) {
|
|
|
|
|
- if ($merchant['miniAppId'] != $authorizeAppId) {
|
|
|
|
|
- util::stop('授权的小程序与商家已绑定的小程序不一致');
|
|
|
|
|
|
|
+ }else{
|
|
|
|
|
+ if (isset($extend['wxAppId']) && !empty($extend['wxAppId'])) {
|
|
|
|
|
+ if ($extend['wxAppId'] != $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]);
|
|
@@ -168,7 +169,6 @@ class WxOpenController extends PublicController
|
|
|
MerchantExtendClass::updateByCondition(['merchantId' => $id], ['wxAppId' => $authorizeAppId,'wxAuth'=>1]);
|
|
MerchantExtendClass::updateByCondition(['merchantId' => $id], ['wxAppId' => $authorizeAppId,'wxAuth'=>1]);
|
|
|
|
|
|
|
|
//还没有完成初始化先进行初始化
|
|
//还没有完成初始化先进行初始化
|
|
|
- $extend = MerchantExtendClass::getByMerchantId($id);
|
|
|
|
|
if (isset($extend['init']) && $extend['init'] == 0) {
|
|
if (isset($extend['init']) && $extend['init'] == 0) {
|
|
|
$data = ['merchantId' => $id];
|
|
$data = ['merchantId' => $id];
|
|
|
$producer = Yii::$app->rabbitmq->getProducer('openShopInitProducer');
|
|
$producer = Yii::$app->rabbitmq->getProducer('openShopInitProducer');
|