Example #1
0
	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));
	}
 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);
 }
 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);
 }
Example #4
0
    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);
    }
Example #5
0
	public function __construct(){

		

		parent::__construct();
		if($this->_get('wecha_id')){
			$cover = 0;
		}else{
			$cover = 1;
		}
		$this->assign('cover',$cover);

		$this->token=session('token');

		// $this->token = $this->_get('token');

		$this->assign('token',$this->token);

		$this->wecha_id	= $this->_get('wecha_id');

		if (!$this->wecha_id){

			$this->wecha_id='null';

		}
			$where['token']=$this->token;

		$this->assign('wecha_id',$this->wecha_id);
     



	}
Example #6
0
	public function __construct(){

		parent::__construct();

		$this->token=session('token');

		// $this->token = $this->_get('token');

		$this->assign('token',$this->token);

		$this->wecha_id	= $this->_get('wecha_id');

		if (!$this->wecha_id){

			$this->wecha_id='null';

		}
			
		$this->assign('wecha_id',$this->wecha_id);

		$this->scene_model=M('Scene');
		$this->scene_addtp=M('scene_addtp');


	}
Example #7
0
 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();
     }
 }
Example #8
0
	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);
		}
	}
Example #9
0
	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();
	}
Example #10
0
	public function _initialize() {
		parent::_initialize();
		session('wapupload',1);
		if (!$this->wecha_id){
			$this->error('您无权访问','');
		}
	}
Example #11
0
 public function __construct()
 {
     parent::_initialize();
     $this->field_db = M('custom_field');
     $this->info_db = M('custom_info');
     $this->limit_db = M('custom_limit');
     $this->token = $this->_get('token');
     if (!defined('RES')) {
         define('RES', THEME_PATH . 'common');
     }
     //$this->wecha_id		= $this->_get('wecha_id');
     if (!$this->wecha_id) {
         $this->wecha_id = 'null';
     }
     $this->thisForm = M('custom_set')->where(array('token' => $this->token, 'set_id' => $this->_get('id', 'intval')))->find();
     $this->assign('token', $this->token);
     $this->assign('thisForm', $this->thisForm);
     $this->assign('wecha_id', $this->wecha_id);
     if (C('baidu_map')) {
         $this->isamap = 0;
     } else {
         $this->isamap = 1;
         $this->amap = new amap();
     }
 }
Example #12
0
 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);
 }
Example #13
0
 public function _initialize()
 {
     parent::_initialize();
     if (!$this->wecha_id) {
         $this->error('您无权访问', '');
     }
 }
Example #14
0
    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));
        
    }
Example #15
0
	public function __construct(){
		
		

		parent::__construct();

		$this->token=session('token');

		// $this->token = $this->_get('token');

		$this->assign('token',$this->token);

		$this->wecha_id	= $this->_get('wecha_id');

		if (!$this->wecha_id){

			$this->wecha_id='null';

		}
			$where['token']=$this->token;
		$kefu=M('Kefu')->where($where)->find();
		$this->assign('kefu',$kefu);

		$this->assign('wecha_id',$this->wecha_id);

		$this->Zhaopin_model=M('Zhaopin');

		
		

		



	}
Example #16
0
 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;
 }
Example #17
0
 public function __construct()
 {
     parent::__construct();
     //普通活动或者现场活动
     $this->act_type = $this->_get('act_type', 'intval');
     $this->shake_model = M('Shake');
 }
Example #18
0
	public function __construct(){

		

		parent::__construct();

		$this->token=session('token');

		// $this->token = $this->_get('token');

		$this->assign('token',$this->token);

		$this->wecha_id	= $this->_get('wecha_id');

		if (!$this->wecha_id){

			$this->wecha_id='null';

		}
			$where['token']=$this->token;
		
		$this->assign('wecha_id',$this->wecha_id);

		$this->Yingyong_model=M('Yingyong');

	
		

		



	}
Example #19
0
	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));
	}
Example #20
0
	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 = "******";
		
		$this->assign('totalDishCount', $count);
		$where['token']=$this->token;
		$kefu=M('Kefu')->where($where)->find();
		$this->assign('kefu',$kefu);

	}
Example #21
0
	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);
	}
Example #22
0
 public function _initialize()
 {
     parent::_initialize();
     $this->action_id = $this->_get("id", "intval");
     $this->token = $this->_get("token", "trim");
     $this->action = M("numqueue_action")->where(array("id" => $this->action_id, "token" => $this->token, "is_open" => 1))->find();
     $this->assign("isFuwu", $this->isFuwu);
 }
Example #23
0
 public function _initialize()
 {
     parent::_initialize();
     $this->m_bargain = M('bargain');
     $this->m_order = M('bargain_order');
     $this->m_kanuser = M('bargain_kanuser');
     $this->m_userinfo = M('userinfo');
 }
Example #24
0
 public function __construct()
 {
     parent::_initialize();
     $this->token = $this->_get('token');
     if (strlen($this->token) > 32) {
         die($this->token);
     }
 }
Example #25
0
 public function _initialize()
 {
     parent::_initialize();
     $this->action_id = $this->_get('id', 'intval');
     $this->token = $this->_get('token', 'trim');
     $this->action = M('numqueue_action')->where(array('id' => $this->action_id, 'token' => $this->token, 'is_open' => 1))->find();
     $this->assign('isFuwu', $this->isFuwu);
 }
	public function _initialize() {
		parent::_initialize();
		$this->token=$this->_get('token');
		$this->assign('token',$this->token);
		$this->apikey=C('baidu_map_api');
		$this->assign('apikey',$this->apikey);
		$this->assign('staticFilePath',str_replace('./','/',THEME_PATH.'common/css/product'));
	}
Example #27
0
 public function _initialize()
 {
     parent::_initialize();
     $this->helping = M('Helping')->where(array('token' => $this->token, 'id' => $this->_get('id', 'intval'), 'is_open' => 1))->find();
     if (empty($this->helping)) {
         $this->error('活动可能还没开启');
     }
     $this->assign('info', $this->helping);
 }
 protected function _initialize()
 {
     define('PHONE_PAY', 9000);
     define('INTERNET_PAY', 9001);
     parent::_initialize();
     //获取合作伙伴id
     $fxs_id = $this->_get('fxs_id');
     if (!$fxs_id) {
         $fxs_id = session('fxs_id');
     }
     $this->fxs_userid = $fxs_id;
     session('fxs_id', $fxs_id);
     $this->wechat_id = session('wechat_id_' . $this->token);
     $this->branch_id = $this->_get('partner_id');
     $opened_funcs = session('opened_funcs_' . $this->token);
     $cur_func = 'shangcheng';
     if (!in_array($cur_func, $opened_funcs)) {
         Log::record('Shop function verification failed: token:' . $this->token . ' opened_funcs:' . print_r($opened_funcs, true));
         Log::save();
         echo 'Sorry!';
         exit;
     }
     $this->is_need_auth = $this->isNeedDoAuth();
     $this->assign('token', $this->token);
     $this->assign('staticFilePath', str_replace('./', '/', THEME_PATH . 'common/css/product'));
     //购物车信息
     $cart_items = $this->getCart();
     $item_count = 0;
     foreach ($cart_items as $key => $item) {
         $item_count += $item['count'];
     }
     $this->assign('cart_item_count', $item_count);
     //商城信息
     $shop_where = array('token' => $this->token, 'status' => 1);
     $this->branch_id = intval($_GET['bid']);
     if (!empty($this->branch_id)) {
         $shop_where['fake_id'] = $this->branch_id;
     }
     $shop_db = M('b2c_shop');
     $shop = $shop_db->where($shop_where)->find();
     if (empty($this->branch_id)) {
         $this->branch_id = $shop['fake_id'];
     }
     $this->assign('shop', $shop);
     $my_url = '#';
     if ($this->is_need_auth && !$this->wechat_id) {
         $my_url = $this->generateAuthUrl('Shop/my', array('fxs_id' => $fxs_id));
     } else {
         $my_url = $this->generateUrl('Shop/my', array('fxs_id' => $fxs_id));
     }
     $this->assign('my_url', $my_url);
     $cart_url = $this->generateUrl('Shop/cart', array('bid' => $this->branch, 'fxs_id' => $fxs_id, 'partner_id' => $this->branch_id));
     $this->assign('cart_url', $cart_url);
     $home_url = $this->generateUrl('Shop/index', array('fxs_id' => $fxs_id));
     $this->assign('home_url', $home_url);
 }
 public function _initialize()
 {
     parent::_initialize();
     $where['token'] = $this->token;
     $tpl = $this->wxuser;
     $this->weixinUser = $tpl;
     $kefu = $this->kefu;
     $this->assign('kefu', $kefu);
     if (isset($_GET['wecha_id']) && $_GET['wecha_id']) {
         $_SESSION['wecha_id'] = $_GET['wecha_id'];
         $this->wecha_id = $this->_get('wecha_id');
     }
     if (isset($_SESSION['wecha_id'])) {
         $this->wecha_id = $_SESSION['wecha_id'];
     }
     //$info=M('Classify')->where(array('token'=>$this->_get('token'),'status'=>1,'fid'=>0))->order('sorts desc')->select();
     $allClasses = M('Classify')->where(array('token' => $this->_get('token'), 'status' => 1))->order('sorts desc')->select();
     $allClasses = $this->convertLinks($allClasses);
     //加外链等信息
     $this->allClasses = $allClasses;
     $info = array();
     if ($allClasses) {
         $classByID = array();
         $firstGradeCatCount = 0;
         foreach ($allClasses as $c) {
             $classByID[$c['id']] = $c;
             if ($c['fid'] == 0) {
                 $c['sub'] = array();
                 $info[$c['id']] = $c;
                 $firstGradeCatCount++;
             }
         }
         foreach ($allClasses as $c) {
             if ($c['fid'] > 0 && $info[$c['fid']]) {
                 array_push($info[$c['fid']]['sub'], $c);
             }
         }
         //
         if ($info) {
             foreach ($info as $c) {
                 $info[$c['id']]['key'] = $firstGradeCatCount--;
             }
         }
     }
     $homeInfo = $this->homeInfo;
     $homeInfo['info'] = str_replace(array("\r\n", "\"", "&quot;"), array(' ', '', ''), $homeInfo['info']);
     $this->homeInfo['info'] = $homeInfo['info'];
     $this->info = $info;
     $tpl['color_id'] = intval($tpl['color_id']);
     $this->tpl = $tpl;
     ////~~~即將替代~~ plugmenus~~old~~
     $plugMenus = $this->_getPlugMenu();
     $this->assign('plugmenus', $catemenu);
     $this->assign('showPlugMenu', count($catemenu));
     $this->assign('token', $this->token);
 }
Example #30
0
 public function _initialize()
 {
     parent::_initialize();
     $this->action_id = $this->_get('id', 'intval');
     $this->share_code = $this->_get('share_code', 'trim');
     $this->action = M('seckill_action')->where(array('action_id' => $this->action_id, 'action_open' => 0))->find();
     $this->shop = M('seckill_base_shop')->where(array('action_id' => $this->action_id, 'shop_open' => 0))->select();
     $this->cdata = $this->action['action_key'];
     $this->sessarr = $_SESSION[$this->cdata];
 }