當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WapAction::_initialize方法代碼示例

本文整理匯總了PHP中WapAction::_initialize方法的典型用法代碼示例。如果您正苦於以下問題:PHP WapAction::_initialize方法的具體用法?PHP WapAction::_initialize怎麽用?PHP WapAction::_initialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WapAction的用法示例。


在下文中一共展示了WapAction::_initialize方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _initialize

	public function _initialize(){
		parent::_initialize();
		$agent = $_SERVER['HTTP_USER_AGENT']; 
		if (!strpos($agent, "MicroMessenger")) {
			//echo '此功能隻能在微信瀏覽器中使用';exit;
		}
		
		$this->token = isset($_REQUEST['token']) ? $_REQUEST['token'] : session('token');//$this->_get('token');
		
		$this->assign('token', $this->token);
		$this->wecha_id	= isset($_REQUEST['wecha_id']) ? $_REQUEST['wecha_id'] : '';
		$this->assign('wecha_id', $this->wecha_id);
		
		$this->_cid = $_SESSION["session_hotel_{$this->token}"];
		$this->assign('cid', $this->_cid);
		
		$this->session_dish_info = "session_hotel_{$this->_cid}_info_{$this->token}";
		$this->session_dish_user = "session_hotel_{$this->_cid}_user_{$this->token}";
		
		$this->assign('totalDishCount', $count);
		$where['token']=$this->token;
		$kefu=M('Kefu')->where($where)->find();
		$this->assign('kefu',$kefu);

	}
開發者ID:royalwang,項目名稱:saivi,代碼行數:25,代碼來源:HotelsAction.class.php

示例2: _initialize

 public function _initialize()
 {
     parent::_initialize();
     if (!$this->wecha_id) {
         $this->error('您無權訪問', '');
     }
 }
開發者ID:ailingsen,項目名稱:pigcms,代碼行數:7,代碼來源:UserinfoAction.class.php

示例3: __construct

	public function __construct()
	{
		parent::_initialize();
		
		$this->action_id = $this->_get("id", "intval");
		D("Userinfo")->convertFake(M("cointree_users"), array("token" => $this->token, "wecha_id" => $this->wecha_id, "fakeopenid" => $this->fakeopenid));
	}
開發者ID:kevicki,項目名稱:pig,代碼行數:7,代碼來源:CoinBaseAction.class.php

示例4: _initialize

 public function _initialize()
 {
     parent::_initialize();
     $agent = $_SERVER['HTTP_USER_AGENT'];
     if (!strpos($agent, "MicroMessenger")) {
         //	echo '此功能隻能在微信瀏覽器中使用';exit;
     }
     $this->token = isset($_REQUEST['token']) ? htmlspecialchars($_REQUEST['token']) : session('token');
     $this->session_cart_name = 'session_cart_products_' . $this->token;
     $this->assign('token', $this->token);
     $this->wecha_id = isset($_REQUEST['wecha_id']) ? htmlspecialchars($_REQUEST['wecha_id']) : '';
     if (!$this->wecha_id) {
         //$this->wecha_id='';
         //exit('非法請求');
     }
     $this->assign('wecha_id', $this->wecha_id);
     $this->product_model = M('Product');
     $this->product_cat_model = M('Product_cat');
     $this->assign('staticFilePath', str_replace('./', '/', THEME_PATH . 'common/css/store'));
     //購物車
     $calCartInfo = $this->calCartInfo();
     $this->assign('totalProductCount', $calCartInfo[0]);
     $this->assign('totalProductFee', $calCartInfo[1]);
     $cats = $this->product_cat_model->where(array('token' => $this->token))->order('id asc')->select();
     $this->assign('cats', $cats);
 }
開發者ID:SubDong,項目名稱:pigcms,代碼行數:26,代碼來源:StoreAction.class.php

示例5: _initialize

	public function _initialize()
	{
		parent::_initialize();
		
		$this->action_id = $this->_request('id', 'intval');
		D('Userinfo')->convertFake(M('voteimg_users'), array('token' => $this->token, 'wecha_id' => $this->wecha_id, 'fakeopenid' => $this->fakeopenid));
	}
開發者ID:kevicki,項目名稱:pig,代碼行數:7,代碼來源:VoteimgAction.class.php

示例6: __construct

 public function __construct()
 {
     $this->bid = $this->_get('bid') ? intval($this->_get('bid', 'trim')) : 0;
     parent::_initialize();
     /*$checkFunc=new checkFunc();if (!function_exists('fdsrejsie3qklwewerzdagf4ds')){exit('error-4');}
       $checkFunc->cfdwdgfds3skgfds3szsd3idsj();*/
     if (!$this->wecha_id) {
         $this->wecha_id = '';
         $_SESSION['token_openid_' . $this->token] = '';
     }
     if ($this->owndomain) {
         $this->siteUrl = "http://" . $this->owndomain;
     }
     $this->thisopenduser = $this->bid . '_user' . $this->wecha_id;
     //$loginuserid=isset($_SESSION[$thisopenduser]) && !empty($_SESSION[$thisopenduser]) ? intval($_SESSION[$thisopenduser]) : 0;
     $loginuserid = cookie($this->thisopenduser);
     $this->loginuserid = $loginuserid ? intval($loginuserid) : 0;
     $tmpuserid = $this->_get('loginuserid') ? intval($this->_get('loginuserid', 'trim')) : 0;
     if ($this->owndomain && $this->rget == 3 && $tmpuserid > 0) {
         $this->loginuserid = $tmpuserid;
     }
     $bgimg = $_SESSION['MicroBroker_bgimg' . $this->bid];
     $this->assign('loginuserid', $this->loginuserid);
     $this->assign('wecha_id', $this->wecha_id);
     $this->assign('bid', $this->bid);
     $this->assign('bgimg', $bgimg);
 }
開發者ID:liuguogen,項目名稱:weixin,代碼行數:27,代碼來源:MicroBrokerAction.class.php

示例7: __construct

 public function __construct()
 {
     parent::_initialize();
     if (!defined('RES')) {
         define('RES', THEME_PATH . 'common');
     }
     //$this->wecha_id=$this->wecha_id;
     $this->assign('wecha_id', $this->wecha_id);
     //
     $this->token = $this->_get('token');
     $this->thisUser = M('Userinfo')->where(array('token' => $this->_get('token'), 'wecha_id' => $this->wecha_id))->find();
     if (!$this->wecha_id && ACTION_NAME != 'companyMap') {
         $this->error('您沒有權限使用會員卡,如需使用請關注微信“' . $this->wxuser['wxname'] . '”並回複會員卡', U('Index/index', array('token' => $this->token)));
     }
     $action = array('index', 'companyMap', 'payReturn');
     if (!in_array(ACTION_NAME, $action) && empty($_GET['cardid'])) {
         $this->error('請領取會員卡後再操作');
     }
     if (C('baidu_map')) {
         $this->isamap = 0;
     } else {
         $this->isamap = 1;
         $this->amap = new amap();
     }
 }
開發者ID:node-rookie,項目名稱:bdg,代碼行數:25,代碼來源:CardAction.class.php

示例8: _initialize

	public function _initialize()
	{
		parent::_initialize();
		
		$this->fans = M("userinfo")->where(array("token" => $this->token, "wecha_id" => $this->wecha_id))->find();

		if ($this->fans == "") {
		}

		$id = $this->_get("id", "intval");
		$info = M("Collectword")->where(array("id" => $id, "token" => $this->token, "is_open" => 0))->find();
		$this->info = $info;
		$news_list = S($id . "Collectword" . $this->token . "news");

		if ($news_list == "") {
			$news_list = M("CollectwordNews")->where(array("token" => $this->token, "pid" => $id))->order("id")->select();

			foreach ($news_list as $nk => $nv ) {
				$news_list[$nk]["url"] = $this->getLink($nv["url"]);
			}

			S($id . "Collectword" . $this->token . "news", $news_list);
		}

		$prize_list = M("CollectwordPrize")->where(array("token" => $this->token, "pid" => $id))->order("id")->select();

		if ("1" == $_GET["isjoin"]) {
			if ($this->info["start"] < time()) {
				M("CollectwordUser")->where(array("pid" => $id, "token" => $this->token, "wecha_id" => $this->wecha_id))->setField("is_join", "1");
			}
			else {
				$this->error("活動尚未開始。");
			}
		}

		$params["word"] = $this->info["word"];
		$params["count"] = $prize_list[0]["num"];
		$params["sCount"] = $params["count"] - M("CollectwordUser")->where(array("token" => $this->token, "pid" => $id, "is_prize" => "1"))->count();
		$params["time"] = $this->info["end"] - time();
		$params["expect"] = $this->info["expect"];
		$this->collectword = new CollectWord($params);
		$this->info["wordNum"] = $this->collectword->getLength();
		$this->info["word"] = $this->collectword->getWord();
		$this->assign("news_list", $news_list);
		$this->assign("prize_list", $prize_list);
		$this->info["fxtitle_d"] = strtr($this->info["fxtitle"], array("{{活動名稱}}" => $this->info["title"]));
		$this->info["fxinfo_d"] = strtr($this->info["fxinfo"], array("{{活動名稱}}" => $this->info["title"]));
		$this->info["fxtitle"] = strtr($this->info["fxtitle"], array("{{活動名稱}}" => $this->info["title"], "{{字數}}" => count($this->_record())));
		$this->info["fxinfo"] = strtr($this->info["fxinfo"], array("{{活動名稱}}" => $this->info["title"], "{{字數}}" => count($this->_record())));
		$this->info["prize_fxtitle"] = strtr($this->info["prize_fxtitle"], array("{{活動名稱}}" => $this->info["title"], "{{獎品名稱}}" => $prize_list[0]["title"]));
		$this->info["prize_fxinfo"] = strtr($this->info["prize_fxinfo"], array("{{活動名稱}}" => $this->info["title"], "{{獎品名稱}}" => $prize_list[0]["title"]));
		$this->info["reply_pic"] = (empty($this->info["fxpic"]) ? $this->info["reply_pic"] : $this->info["fxpic"]);
		$replyPic = strstr($this->info["reply_pic"], "://");

		if (empty($replyPic)) {
			$this->info["reply_pic"] = C("site_url") . $this->info["reply_pic"];
		}

		$this->assign("info", $this->info);
	}
開發者ID:kevicki,項目名稱:pig,代碼行數:60,代碼來源:CollectwordAction.class.php

示例9: _initialize

	public function _initialize(){
		parent::_initialize();
		$agent = $_SERVER['HTTP_USER_AGENT']; 
		if(!strpos($agent,"MicroMessenger")) {
		//	echo '此功能隻能在微信瀏覽器中使用';exit;
		}
		
		$this->token		= $this->_get('token');
		$this->session_cart_name='session_cart_products_'.$this->token;
		$this->assign('token',$this->token);
		$this->wecha_id	= $this->wecha_id;
		if (!$this->wecha_id){
			//$this->wecha_id='';
		}
		$this->assign('wecha_id',$this->wecha_id);
		$this->product_model=M('Product');
		$this->product_cat_model=M('Product_cat');
		//define('RES',THEME_PATH.'common');
		//define('STATICS',TMPL_PATH.'static');
		$this->assign('staticFilePath',str_replace('./','/',THEME_PATH.'common/css/product'));
		//購物車
		$calCartInfo=$this->calCartInfo();
		$this->assign('totalProductCount',$calCartInfo[0]);
		$this->assign('totalProductFee',$calCartInfo[1]);
		//是否是餐飲
		if (isset($_GET['dining'])&&intval($_GET['dining'])){
			$this->isDining=1;
			$this->assign('isDining',1);
		}
	}
開發者ID:kevicki,項目名稱:pig,代碼行數:30,代碼來源:ProductAction.class.php

示例10: _initialize

 public function _initialize()
 {
     parent::_initialize();
     $this->token = filter_var($this->_get('token'), FILTER_SANITIZE_STRING);
     $this->wecha_id = filter_var($this->wecha_id, FILTER_SANITIZE_STRING);
     $this->type = filter_var($this->_get('type'), FILTER_SANITIZE_STRING);
     $this->bid = filter_var($this->_get('bid'), FILTER_VALIDATE_INT);
     $arrAllow = array('fitness', 'gover', 'food', 'travel', 'flower', 'property', 'ktv', 'bar', 'fitment', 'wedding', 'affections', 'housekeeper', 'lease', 'beauty');
     $orderid = filter_var($this->_get('orderid'), FILTER_SANITIZE_STRING);
     if (!in_array($this->type, $arrAllow) && empty($_GET['orderid'])) {
         $this->error('抱歉,您的參數不合法!', U('Index/index', array('token' => $this->token, 'wecha_id' => $this->wecha_id)));
     }
     $where = array('token' => $this->token, 'type' => $this->type, 'bid' => $this->bid);
     $busines = M('busines')->where($where)->find();
     $this->assign('busines', $busines);
     $this->assign('picurl', $busines['picurl']);
     $this->assign('title', $busines['title']);
     $this->assign('token', $this->token);
     $this->assign('wecha_id', $this->wecha_id);
     $this->assign('type', $this->type);
     $this->assign('bid', $this->bid);
     $where['token'] = $this->token;
     $kefu = M('Kefu')->where($where)->find();
     $this->assign('kefu', $kefu);
     $tpl = $this->wxuser;
     $this->tpl = $tpl;
 }
開發者ID:liuguogen,項目名稱:weixin,代碼行數:27,代碼來源:BusinessAction.class.php

示例11: _initialize

	public function _initialize()
	{
		parent::_initialize();
		
		$this->action_id = $this->_get("id", "intval");
		$this->my_packets = M("hongbao_grabber")->where("hongbao_id = $this->action_id and token = '$this->token' and grabber_wechaid = '$this->wecha_id'")->find();
	}
開發者ID:kevicki,項目名稱:pig,代碼行數:7,代碼來源:HongbaoAction.class.php

示例12: _initialize

	public function _initialize() {
		parent::_initialize();
		session('wapupload',1);
		if (!$this->wecha_id){
			$this->error('您無權訪問','');
		}
	}
開發者ID:kevicki,項目名稱:pig,代碼行數:7,代碼來源:UserinfoAction.class.php

示例13: _initialize

 protected function _initialize()
 {
     parent::_initialize();
     $opened_funcs = session('opened_funcs_' . $this->token);
     $cur_func = 'canyin';
     if (!in_array($cur_func, $opened_funcs)) {
         //Log::record('Dining function verification failed: token:'.$this->token.' opened_funcs:'.print_r($opened_funcs, true));
         //Log::save();
         echo '沒有開啟餐飲功能!';
         exit;
     }
     if (empty($this->wechat_id)) {
         //未登錄
         if ($this->wechat_type == 1 && $this->is_authed == 1) {
             $host_name = C('wx_handler_server');
             $cur_url = urlencode('http://' . $host_name . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'] . "#wechat_redirect");
             //必須是認證過的服務號
             $redirect = urlencode('http://' . $host_name . "/index.php?g=Wap&m=Oauth2&a=index&backurl=" . $cur_url . "#wechat_redirect");
             $auth_url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" . $this->appid . "&redirect_uri=" . $redirect . "&response_type=code&scope=snsapi_userinfo&state=" . $this->token . "#wechat_redirect";
             //Log::record('auth_url'.$auth_url);
             header("Location:{$auth_url}");
             //確保重定向後,後續代碼不會被執行
         }
     }
     $this->assign('token', $this->token);
 }
開發者ID:zhaoshengloveqingqing,項目名稱:Wechat,代碼行數:26,代碼來源:DiningAction.class.php

示例14: __construct

    public function __construct() {

        $this->bid = $this->_get('bid') ? intval($this->_get('bid', 'trim')) : 0;
        parent::_initialize();
		
        if (!$this->wecha_id) {
            $this->wecha_id = '';
            $_SESSION['token_openid_' . $this->token] = '';
        }
		if($this->owndomain){
		   $this->siteUrl="http://".$this->owndomain;
		}
        $this->thisopenduser = $this->bid . '_user' . $this->wecha_id;
        //$loginuserid=isset($_SESSION[$thisopenduser]) && !empty($_SESSION[$thisopenduser]) ? intval($_SESSION[$thisopenduser]) : 0;
        $loginuserid = cookie($this->thisopenduser);
        $this->loginuserid = $loginuserid ? intval($loginuserid) : 0;
		$tmpuserid=$this->_get('loginuserid') ? intval($this->_get('loginuserid','trim')) : 0;
		if($this->owndomain && ($this->rget==3) && ($tmpuserid>0)){
		  $this->loginuserid=$tmpuserid;
		}
		$bgimg=$_SESSION['MicroBroker_bgimg' . $this->bid];
        $this->assign('loginuserid', $this->loginuserid);
        $this->assign('wecha_id', $this->wecha_id);
        $this->assign('bid', $this->bid);
		$this->assign('bgimg', $bgimg);
    }
開發者ID:kevicki,項目名稱:pig,代碼行數:26,代碼來源:MicroBrokerAction.class.php

示例15: __construct

    public function __construct(){
        parent::_initialize();
        if (!defined('RES')){
            define('RES',THEME_PATH.'common');
        }
        //$this->wecha_id=$this->wecha_id;
        $this->assign('wecha_id',$this->wecha_id);
        //
        $this->token=$this->_get('token');
        $this->thisUser = M('Userinfo')->where(array('token'=>$this->_get('token'),'wecha_id'=>$this->wecha_id))->find();
        if (!$this->wecha_id && ACTION_NAME != 'companyMap'){
        	$name = $this->isFuwu ? '服務窗' : '微信';
            $this->error('您沒有權限使用會員卡,如需使用請關注'.$name.'“'.$this->wxuser['wxname'].'”並回複會員卡',U('Index/index',array('token'=>$this->token)));
        }

        $action = array('index', 'companyMap','payReturn');
        if(!in_array(ACTION_NAME,$action) && empty($_GET['cardid'])){
            $this->error('請領取會員卡後再操作');
        }
		if (C('baidu_map')){
            $this->isamap=0;
        }else {
            $this->isamap=1;
            $this->amap=new amap();
        }
        // 校正數據表
        D('Userinfo')->convertFake(M('MemberCardCreate'), array('token'=>$this->token, 'fakeopenid'=> $this->fakeopenid, 'wecha_id'=>$this->wecha_id));
        D('Userinfo')->convertFake(M('MemberCardCouponRecord'), array('token'=>$this->token, 'fakeopenid'=> $this->fakeopenid, 'wecha_id'=>$this->wecha_id));
        D('Userinfo')->convertFake(M('MemberCardPayRecord'), array('token'=>$this->token, 'fakeopenid'=> $this->fakeopenid, 'wecha_id'=>$this->wecha_id));
        D('Userinfo')->convertFake(M('MemberCardSign'), array('token'=>$this->token, 'fakeopenid'=> $this->fakeopenid, 'wecha_id'=>$this->wecha_id));
        D('Userinfo')->convertFake(M('MemberCardUseRecord'), array('token'=>$this->token, 'fakeopenid'=> $this->fakeopenid, 'wecha_id'=>$this->wecha_id));
        
    }
開發者ID:kevicki,項目名稱:pig,代碼行數:33,代碼來源:CardAction.class.php


注:本文中的WapAction::_initialize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。