appid}&secret={$this->secret}"; $r = file_get_contents($url); $ret = json_decode($r, true); return $ret['access_token']; } public function getURLScheme() { $url = "https://api.weixin.qq.com/wxa/generatescheme?access_token=".$this->getAccessToken(); $data = [ 'jump_wxa' => [ 'path' => '/pages/share/share', 'query' => 'id=3' ], 'is_expire' => false, "expire_time" => 1606737600 ]; $ret = curl_post($url, json_encode($data)); echo $ret; } public function jumpMp() { $this->display(); } // MiniTop 二维码推广 public function getImgs() { $id = I('request.id', 0); // 二维码 $qrcodePromotionList = M('qrcode_promotion_list', 'tab_')->where(['id' => $id])->find(); // 背景图 $qrcodePromotion = M('qrcode_promotion', 'tab_')->where(['id' => $qrcodePromotionList['qp_id']])->find(); $this->ajaxReturn([ 'status' => 1, 'background_img' => $qrcodePromotion['background_img'], 'qrcode_img' => $qrcodePromotionList['qrcode_img'] ]); } }