Commit 8e31535c authored by hezhen's avatar hezhen

123

parent 61b4bcc6
......@@ -128,19 +128,33 @@ require_once ROOT_PATH . '/inc/we7.php';
global $_GPC;
global $_W;
$uniacid = $_W['uniacid'];
$to_uid = $_GPC['user_id'];
$user_id = $_GPC['user_id'];
$to_uid = $_GPC['to_uid'];
$goods_id = $_GPC['id'];
//1:旅游,2租车,3营地
$type = $_GPC['type'];
$userInfo=pdo_get('longbing_company_user',array('id'=>$to_uid,'uniacid'=>$_W['uniacid']));
$userInfo=pdo_get('longbing_company_user',array('id'=>$user_id,'uniacid'=>$_W['uniacid']));
$destination_folder = '/images' . ('/longbing_company/' . $_W['uniacid']);
if ($userInfo&&$userInfo['platform_userid']){
$pid=$userInfo['platform_userid'];
$to_uid=$user_id;
$image = $destination_folder . '/' . $_W['uniacid'] . '-goods'.$type.'-' . $goods_id . '-' . $to_uid . 'qr.png';
$url = $_W['siteroot'] . $_W['config']['upload']['attachdir'] . '/' . $image;
}else{
$image2 = $destination_folder . '/' . $_W['uniacid'] . '-goods'.$type.'-' . $goods_id . 'qr.png';
$url = $_W['siteroot'] . $_W['config']['upload']['attachdir'] . '/' . $image2;
if ($to_uid){
$userInfo=pdo_get('longbing_company_user',array('id'=>$to_uid,'uniacid'=>$_W['uniacid']));
if ($userInfo&&$userInfo['platform_userid']){
$pid=$userInfo['platform_userid'];
$image = $destination_folder . '/' . $_W['uniacid'] . '-goods'.$type.'-' . $goods_id . '-' . $to_uid . 'qr.png';
}else{
$to_uid='';
$image = $destination_folder . '/' . $_W['uniacid'] . '-goods'.$type.'-' . $goods_id . 'qr.png';
}
}else{
$image = $destination_folder . '/' . $_W['uniacid'] . '-goods'.$type.'-' . $goods_id . 'qr.png';
}
}
$url = $_W['siteroot'] . $_W['config']['upload']['attachdir'] . '/' . $image;
$url = str_replace('ttp://', 'ttps://', $url);
if (!strstr($url, 'ttps://')) {
......@@ -157,7 +171,7 @@ if ($image){
@$size = filesize(ATTACHMENT_ROOT . $image);
if ($size < 51220) {
$path ='longbing_company/tab/pages/home/home?c='.$type.'&id=' . $goods_id . '&pid=' . $userInfo['platform_userid'].'&to_uid='.$to_uid;
$path ='longbing_company/tab/pages/home/home?c='.$type.'&id=' . $goods_id . '&pid=' . $pid.'&to_uid='.$to_uid;
$res = createQr2(ATTACHMENT_ROOT . $image, $path, $_W);
if (is_array($res) && isset($res['errcode'])) {
$appid = $_W['account']['key'];
......@@ -169,7 +183,7 @@ if ($image){
}
}
} else {
$path ='longbing_company/tab/pages/home/home?c='.$type.'&id=' . $goods_id . '&pid=' . $userInfo['platform_userid'].'&to_uid='.$to_uid;
$path ='longbing_company/tab/pages/home/home?c='.$type.'&id=' . $goods_id . '&pid=' .$pid.'&to_uid='.$to_uid;
$res = createQr2(ATTACHMENT_ROOT . $image, $path, $_W);
if (is_array($res) && isset($res['errcode'])) {
$appid = $_W['account']['key'];
......@@ -181,34 +195,5 @@ if ($image){
}
}
}
if ($image2){
if (file_exists(ATTACHMENT_ROOT . $image2)) {
@$size = filesize(ATTACHMENT_ROOT . $image2);
if ($size < 51220) {
$path ='longbing_company/tab/pages/home/home?c='.$type.'&id=' . $goods_id . '&pid=' . $userInfo['platform_userid'].'&to_uid='.$to_uid;
$res = createQr2(ATTACHMENT_ROOT . $image2, $path, $_W);
if (is_array($res) && isset($res['errcode'])) {
$appid = $_W['account']['key'];
$appidMd5 = md5($appid);
if (is_file(IA_ROOT . '/data/tpl/web/' . $appidMd5 . '.txt')) {
@unlink(IA_ROOT . '/data/tpl/web/' . $appidMd5 . '.txt');
}
}
}
} else {
$path ='longbing_company/tab/pages/home/home?c='.$type.'&id=' . $goods_id . '&pid=' . $userInfo['platform_userid'].'&to_uid='.$to_uid;
$res = createQr2(ATTACHMENT_ROOT . $image2, $path, $_W);
if (is_array($res) && isset($res['errcode'])) {
$appid = $_W['account']['key'];
$appidMd5 = md5($appid);
if (is_file(IA_ROOT . '/data/tpl/web/' . $appidMd5 . '.txt')) {
unlink(IA_ROOT . '/data/tpl/web/' . $appidMd5 . '.txt');
}
}
}
}
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment