Пример #1
0
 public function a()
 {
     //S('wang','wang');
     //echo S('wang');
     $card = new \Common\Model\WechatModel();
     echo $w = $card->getJsApiTicket();
     //print_r($w);
 }
Пример #2
0
function getOpenId()
{
    if (I('openid')) {
        session('openid', I('openid'));
    }
    $openid = session('openid');
    if (empty($openid) && isWeixinBrowser()) {
        $card = new \Common\Model\WechatModel();
        $card->getOpenId();
    }
    return (string) $openid;
}