예제 #1
0
 public function __construct()
 {
     parent::__construct();
     $this->setSiteId();
     $this->getMenuData();
     $this->getSiteData();
     $this->getDate();
     //判断是否微信访问
     if ($this->_isWeiXin()) {
         //判断是否进入详细页面
         if (ACTION_NAME == 'info') {
             $this->Oauth();
             import("Think.WX.jssdk");
             $model_config = D("WxConfig");
             $appid = $model_config->where("`key`='appid'")->getField("value");
             $appsecret = $model_config->where("`key`='appsecret'")->getField("value");
             $this->jssdk = new \JSSDK($appid, $appsecret);
             $signPackage = $this->jssdk->GetSignPackage();
             $this->assign("signPackage", $signPackage);
             $web = $model_config->where("`key`='web'")->getField("value");
             $this->assign("table", MODULE_NAME);
             $this->assign("web", $web);
             $this->assign("uid", $this->wx_user['uid']);
             $this->assign("is_weixin", true);
         }
     }
 }
예제 #2
0
 public function __construct()
 {
     parent::__construct();
     header("Content-Type: text/html; charset=utf-8");
     $this->setModelConfig();
     $this->setModelUser();
     //$this->openid = 'ox1QntxmnsVy0UYOxIDOGUfPCgqE';
     if ($_GET['openid'] && IS_AJAX) {
         $this->openid = $_GET['openid'];
         $this->user = $this->model_user->where("openid='{$this->openid}' and is_subscribe=1")->find();
         $this->user['score'] = D("Users")->where("openid='{$this->openid}'")->getField("score");
         $this->user['uid'] = D("Users")->where("openid='{$this->openid}'")->getField("id");
     } else {
         $this->Oauth();
     }
 }
예제 #3
0
 public function __construct()
 {
     parent::__construct();
     header("Content-Type: text/html; charset=utf-8");
     $this->setModelConfig();
     $this->setModelUser();
     //$this->openid = 'ox1QntxmnsVy0UYOxIDOGUfPCgqE';
     if ($_GET['openid'] && IS_AJAX) {
         $this->openid = $_GET['openid'];
         $this->user = $this->model_user->where("openid='{$this->openid}' and is_subscribe=1")->find();
         $this->user['score'] = D("Users")->where("openid='{$this->openid}'")->getField("score");
         $this->user['uid'] = D("Users")->where("openid='{$this->openid}'")->getField("id");
     } else {
         $this->Oauth();
         //初始化jssdk信息
         import("Think.WX.jssdk");
         $this->jssdk = new \JSSDK($this->getAppid(), $this->getAppsecret());
         $signPackage = $this->jssdk->GetSignPackage();
         $this->assign("signPackage", $signPackage);
     }
 }
예제 #4
0
 public function __construct()
 {
     parent::__construct();
 }