<?php
/**
 * @Copyright (C) 2017 汉潮 All rights reserved.
 * @License http://www.hanchao9999.com
 * @Author xiaogg <xiaogg@sina.cn>
 */

namespace Home\Controller;
use Common\Controller\HanchaoController;
class PurBaseController extends HanchaoController {
	public function _initialize(){
		parent::_initialize ();
       if(!checksiteauth('DingHuo,MenDian|GongHuoShang|CangKu')){ exit;}
        GLOBAL $PurchaseCategory;
        if(empty($PurchaseCategory))$PurchaseCategory=getcache('PurchaseCategory');
		if($this->shops_info['id'] > 0){$this->assign('SMID',$this->shops_info['shop_id']);}else{$this->assign('SMID',0);};
        $ismobile=is_mobile();$ismobile_cookie=$_COOKIE['ismobile']; 
        if($ismobile && !$ismobile_cookie && !in_array(CONTROLLER_NAME,array('App','Pay','Weixin','Oauth','Ajax','Qrcode','Poster'))){ $this->redirect('Mobile/Index/index'); exit;}
        $city_data=init_city();
        $this->assign($city_data);
        //头部分类
        $header_cate=D("Common/PurchaseCategory")->getcatelist();
        $this->assign('header_cates',$header_cate);
    }
}
?>