作者:WYZ的小舟于SZ | 来源:互联网 | 2024-12-14 19:21
1、文件位置:mntwwwrootaddonswe7_wmallincwebstoretangshitable.inc.php改为下面这个$paramsarr
1、
文件位置:/mnt/wwwroot/.../addons/we7_wmall/inc/web/store/tangshi/table.inc.php 改为下面这个
$params = array( "url" => "tangshi/pages/table/goods?sid=".$sid."&table_id=".$table_id, "scene" => "sid:" . $sid . "/table_id:" . $table_id, "name" => $path )
2、文件位置:/mnt/wwwroot/.../addons/we7_wmall/model/qrcode.mod.php
qrcode_wxapp_build()改为下面这个
function qrcode_wxapp_build($params = array())
{
$url = $params['url'];
if (empty($url)) {
return error(-1, '链接不能为空');
}
$scene = $params['scene'];//print_r($params);exit;
$wxapp = get_plugin_config("wxapp");
$appid = $wxapp['basic']['key'];
$secret = $wxapp['basic']['secret'];
load()->func('communication');
$response = ihttp_get("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=".$appid."&secret=".$secret);
$access_token = json_decode($response['content'],true);
$access_token = $access_token['access_token'];
$data = [
'path' => $params['url'],
// 'scene' => $scene,
'width' => 200,
];
$request_url = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=".$access_token;
$content = ihttp_post($request_url,json_encode($data));
// var_dump($content['content']); die();
if (is_error($content)) {
return $content;
}
$name = ifile_write($content['content'], $params['name']);
return $name;
}