shish hace 6 años
padre
commit
5b00a8f853
Se han modificado 1 ficheros con 5 adiciones y 7 borrados
  1. 5 7
      app/www/controllers/WxOpenController.php

+ 5 - 7
app/www/controllers/WxOpenController.php

@@ -103,7 +103,7 @@ class WxOpenController extends PublicController
 			util::stop('没有获取到公众号帐号基本信息');
 			util::stop('没有获取到公众号帐号基本信息');
 		}
 		}
 		$authorize_info = $authorizeDetailInfo['authorizer_info'];
 		$authorize_info = $authorizeDetailInfo['authorizer_info'];
-		$nick_name = $authorize_info['nick_name'];
+		//$nick_name = $authorize_info['nick_name'];
 		$head_img = $authorize_info['head_img'];
 		$head_img = $authorize_info['head_img'];
 		$service_type_info = $authorize_info['service_type_info'];
 		$service_type_info = $authorize_info['service_type_info'];
 		if ($service_type_info['id'] != 2) {
 		if ($service_type_info['id'] != 2) {
@@ -116,9 +116,7 @@ class WxOpenController extends PublicController
 		$user_name = $authorize_info['user_name'];
 		$user_name = $authorize_info['user_name'];
 		$alias = $authorize_info['alias'];
 		$alias = $authorize_info['alias'];
 		$qrCodeUrl = $authorize_info['qrcode_url'];
 		$qrCodeUrl = $authorize_info['qrcode_url'];
-		$business_info = $authorize_info['business_info'];
-		$open_pay = $business_info['open_pay'];
-		$wxAccessTokenTime = date("Y-m-d H:i:s", (time() + $expires_in - 100));//安全起见,将过期时间设置得比微信里还短100秒
+		$accessTokenTime = date("Y-m-d H:i:s", (time() + $expires_in - 100));//安全起见,将过期时间设置得比微信里还短100秒
 		
 		
 		//开放平台还没有关联公众号,先将开放平台关联公众号
 		//开放平台还没有关联公众号,先将开放平台关联公众号
 		$open = WxOpenService::getOpen();
 		$open = WxOpenService::getOpen();
@@ -126,9 +124,9 @@ class WxOpenController extends PublicController
 			WxOpenService::updateById(1, ['merchantId' => $id]);
 			WxOpenService::updateById(1, ['merchantId' => $id]);
 		}
 		}
 		
 		
-		$merchant = xhMerchantService::getByAppId($authorizeAppId);
-		if (isset($merchant['id']) && $merchant['id'] != $id) {
-			util::stop('授权的公众号不正确');
+		$merchant = MerchantService::getMerchantById($id);
+		if (!empty($merchant['wxAppId']) && $merchant['wxAppId'] != $authorizeAppId) {
+			util::stop('授权的公众号与商家不对应');
 		}
 		}
 		
 		
 		//小程序
 		//小程序