作者 王智

文档修改

... ... @@ -62,7 +62,7 @@ class User extends Api
/*新增会员到管易平台*/
$GuanYiCloud = new GuanYiCloud();
$bool = $GuanYiCloud->getvip($Json['unionId']);
if ($bool == 0) {
if ($bool == 1) {
$GuanYiCloud->addVip($Json['unionId'], $Json['nickName']);
}
$dataUser = [
... ...
... ... @@ -605,29 +605,28 @@ class Api
//生成小程序码
public function InserMiniAppQrCode($Goods_id, $UserId, $Path)
{
// //小程序码
// $options = [
// 'app_id' => appid,
// 'secret' => secret,
// ];
// $app = new Application($options);
// // 获取 access token 实例
// $accessToken = $app->access_token;
// $AccessToken = $accessToken->getToken();
// $url = 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=' . $AccessToken;
// $Json = [
// 'scene' => 'Goods_id=' . $Goods_id . '&User_id=' . $UserId,
// 'path' => $Path,
//// 'is_hyaline' => True
// ];
// $MiniAppQrcodeVendor = $this->curlPost1($url, $Json);
// $PayOrder = $this->PayOrder();
// $path = './MiniAppQrCode/' . $PayOrder . '.png';
$JsonDecode = json_decode('{"errcode":40001,"errmsg":"invalid credential, access_token is invalid or not latest rid: 604f8b86-35e79e71-2a52ba2d"}', true);
//小程序码
$options = [
'app_id' => appid,
'secret' => secret,
];
$app = new Application($options);
// 获取 access token 实例
$accessToken = $app->access_token;
$AccessToken = $accessToken->getToken();
$url = 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=' . $AccessToken;
$Json = [
'scene' => 'Goods_id=' . $Goods_id . '&User_id=' . $UserId,
'path' => $Path,
// 'is_hyaline' => True
];
$MiniAppQrcodeVendor = $this->curlPost1($url, $Json);
$PayOrder = $this->PayOrder();
$path = './MiniAppQrCode/' . $PayOrder . '.png';
$JsonDecode = json_decode($MiniAppQrcodeVendor, true);
if ($JsonDecode['errcode'] && $JsonDecode['errcode'] == 40001) {
$this->error('生成海报超时');
}
return 1;
$res = file_put_contents($path, $MiniAppQrcodeVendor);//将微信返回的图片数据流写入文件
if ($res === false) {
$this->error('生成小程序码失败', 0);
... ...