public static function removeMenu($wechat = null) { if (!$wechat) { $wechat = wechatInstance(); } return $wechat->deleteMenu(); }
public function indexAct() { $weobj = wechatInstance(); $userinfo = \Wechat\Logic\UserLogic::getUserinfo(getOpenid()); $this->assign('userinfo', $userinfo); $this->assign('invitetext', getSysConfig('recommend-text')); $this->assign('activity_text', getSysConfig('share-info')); $this->display(); }
public static function pushTextMsg($openid, $msg, $wechat = '') { if (!$wechat) { $wechat = wechatInstance(); } $data['touser'] = $openid; $data['msgtype'] = 'text'; $data['text'] = array('content' => $msg); return $wechat->sendCustomMessage($data); }
protected function _session_openid() { $wechatObj = wechatInstance(); if ($_GET['code']) { $result = $wechatObj->getOauthAccessToken(); $userInfo = $wechatObj->getUserInfo($result['openid']); $this->_saveUserInfo($userInfo); session('openid', $result['openid']); } else { //$callBackUrl = __BASE__.substr(UC(MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME),1); $callBackUrl = currentUrl(); $url = $wechatObj->getOauthRedirect($callBackUrl, '', 'snsapi_base'); redirect($url); } }