|
|
|
@ -17,29 +17,56 @@ class JumpController extends HomeController
|
|
|
|
|
|
|
|
|
|
public function getURLScheme()
|
|
|
|
|
{
|
|
|
|
|
$id = I('request.id', 0);
|
|
|
|
|
$url = "https://api.weixin.qq.com/wxa/generatescheme?access_token=".$this->getAccessToken();
|
|
|
|
|
$data = [
|
|
|
|
|
'jump_wxa' => [
|
|
|
|
|
'path' => '/pages/share/share',
|
|
|
|
|
'query' => 'id=3'
|
|
|
|
|
'path' => '/pages/index/index',
|
|
|
|
|
'query' => "id={$id}"
|
|
|
|
|
],
|
|
|
|
|
'is_expire' => false,
|
|
|
|
|
"expire_time" => 1606737600
|
|
|
|
|
'is_expire' => true,
|
|
|
|
|
"expire_time" => time() + 86400
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
$ret = curl_post($url, json_encode($data));
|
|
|
|
|
$ret = $this->curl_post($url, json_encode($data));
|
|
|
|
|
|
|
|
|
|
echo $ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function curl_post($url, $post_data = '', $timeout = 3000)
|
|
|
|
|
{
|
|
|
|
|
header("Content-type:text/html;charset=utf-8");
|
|
|
|
|
$ch = curl_init();
|
|
|
|
|
curl_setopt ($ch, CURLOPT_URL, $url);
|
|
|
|
|
curl_setopt ($ch, CURLOPT_POST, 1);
|
|
|
|
|
curl_setopt ($ch, CURLOPT_POSTFIELDS, $post_data);
|
|
|
|
|
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
|
|
|
|
|
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
|
|
|
|
|
curl_setopt($ch, CURLOPT_HEADER, false);
|
|
|
|
|
$file_contents = curl_exec($ch);
|
|
|
|
|
curl_close($ch);
|
|
|
|
|
return $file_contents;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function jumpMp() {
|
|
|
|
|
$id = I('request.id', 0);
|
|
|
|
|
$this->assign("id", $id);
|
|
|
|
|
$this->display();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MiniTop 二维码推广
|
|
|
|
|
public function getImgs()
|
|
|
|
|
{
|
|
|
|
|
$backgroundImg = 'http://'.$_SERVER['HTTP_HOST']."/Public/Qrcode/images/b.png";
|
|
|
|
|
$qrCodeImg = 'http://'.$_SERVER['HTTP_HOST']."/Public/Qrcode/images/qrcode.png";
|
|
|
|
|
$id = I('request.id', 0);
|
|
|
|
|
if (!$id || !is_numeric($id)) {
|
|
|
|
|
$this->ajaxReturn([
|
|
|
|
|
'status' => 1,
|
|
|
|
|
'background_img' => $backgroundImg,
|
|
|
|
|
'qrcode_img' => $qrCodeImg
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
// 二维码
|
|
|
|
|
$qrcodePromotionList = M('qrcode_promotion_list', 'tab_')->where(['id' => $id])->find();
|
|
|
|
|
|
|
|
|
|