コード例 #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\TPWechat();
     if ($weObj->checkAuth($token['weixin_AppId'], $token['weixin_AppSecret'])) {
         $qrCode = $weObj->getQRCode($sceneId, 0);
         if ($qrCode) {
             return $weObj->getQRUrl($qrCode['ticket']);
         }
     }
 }