Пример #1
0
 private function getQrPicUrl($ecid, $sceneId)
 {
     $m = M("Company_info");
     $opt['company_ecid'] = $ecid;
     $token = $m->where($opt)->find();
     //如果接口信息不完整,直接返回
     if ($token['weixin_AppId'] == '' || $token['weixin_AppSecret'] == '') {
         return;
     }
     $weObj = new \Org\Weixin\Wechat();
     if ($weObj->checkAuth($token['weixin_AppId'], $token['weixin_AppSecret'])) {
         $qrCode = $weObj->getQRCode($sceneId, 0);
         if ($qrCode) {
             return $weObj->getQRUrl($qrCode['ticket']);
         }
     }
 }
Пример #2
0
 private function getQrPicUrl($ecid, $sceneId)
 {
     $token = $this->getAppToken($ecid);
     //如果接口信息不完整,直接返回
     if ($token['weixin_AppId'] == '' || $token['weixin_AppSecret'] == '') {
         return;
     }
     $weObj = new \Org\Weixin\Wechat();
     if ($weObj->checkAuth($token['weixin_AppId'], $token['weixin_AppSecret'])) {
         $qrCode = $weObj->getQRCode($sceneId, 1);
         if ($qrCode) {
             return $weObj->getQRUrl($qrCode['ticket']);
         }
     }
 }