作者 王智

文档修改

@@ -638,25 +638,27 @@ class Api @@ -638,25 +638,27 @@ class Api
638 public function UserInserMiniAppQrCode($UserId, $Path) 638 public function UserInserMiniAppQrCode($UserId, $Path)
639 { 639 {
640 //小程序码 640 //小程序码
641 - $options = [  
642 - 'app_id' => appid,  
643 - 'secret' => secret,  
644 - ];  
645 - $app = new Application($options);  
646 - // 获取 access token 实例  
647 - $accessToken = $app->access_token;  
648 - $AccessToken = $accessToken->getToken();  
649 - $url = 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=' . $AccessToken;  
650 - $Json = [  
651 - 'scene' => 'Goods_id=0&User_id=' . $UserId,  
652 - 'path' => $Path,  
653 -// 'is_hyaline' => True  
654 - ];  
655 - $MiniAppQrcodeVendor = $this->curlPost1($url, $Json);  
656 - $JsonDecode = json_decode($MiniAppQrcodeVendor, true); 641 +// $options = [
  642 +// 'app_id' => appid,
  643 +// 'secret' => secret,
  644 +// ];
  645 +// $app = new Application($options);
  646 +// // 获取 access token 实例
  647 +// $accessToken = $app->access_token;
  648 +// $AccessToken = $accessToken->getToken();
  649 +// $url = 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=' . $AccessToken;
  650 +// $Json = [
  651 +// 'scene' => 'Goods_id=0&User_id=' . $UserId,
  652 +// 'path' => $Path,
  653 +//// 'is_hyaline' => True
  654 +// ];
  655 +// $MiniAppQrcodeVendor = $this->curlPost1($url, $Json);
  656 +// $JsonDecode = json_decode($MiniAppQrcodeVendor, true);
  657 + $JsonDecode = json_decode('{"errcode":40001,"errmsg":"invalid credential, access_token is invalid or not latest rid: 604f8b86-35e79e71-2a52ba2d"}', true);
657 if ($JsonDecode['errcode'] && $JsonDecode['errcode'] == 40001) { 658 if ($JsonDecode['errcode'] && $JsonDecode['errcode'] == 40001) {
658 $this->error('网咯拥堵'); 659 $this->error('网咯拥堵');
659 } 660 }
  661 + return 1;
660 $PayOrder = $this->PayOrder(); 662 $PayOrder = $this->PayOrder();
661 $path = './MiniAppQrCode/' . $UserId . '.png'; 663 $path = './MiniAppQrCode/' . $UserId . '.png';
662 $res = file_put_contents($path, $MiniAppQrcodeVendor);//将微信返回的图片数据流写入文件 664 $res = file_put_contents($path, $MiniAppQrcodeVendor);//将微信返回的图片数据流写入文件