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

namespace Home\Controller;
use Common\Controller\HanchaoController;
class BaseController extends HanchaoController {
	public function _initialize(){
		parent::_initialize ();
        GLOBAL $GoodsCategory;
        if(empty($GoodsCategory))$GoodsCategory=getcache('GoodsCategory');
		if($this->member_info['id'] > 0){$this->assign('MID',$this->member_info['id']);}else{$this->assign('MID',0);};
		if($this->shops_info['shop_id'] > 0){$this->assign('SMID',$this->shops_info['shop_id']);}else{$this->assign('SMID',0);};
        if(I('ismobile'))cookie('ismobile',I('ismobile')); 
        $ismobile=is_mobile();$ismobile_cookie=cookie('ismobile'); 
        if($ismobile && !$ismobile_cookie && !in_array(CONTROLLER_NAME,array('Distribute','Face','App','Pay','Weixin','Oauth','Ajax','Qrcode','Poster','File','Public','LiveAnchor'))){ $this->redirect('Mobile/Index/index'); exit;}
        $city_data=init_city();
        $this->assign($city_data);
        //头部分类
        $header_cate=D("Common/GoodsCategory")->getcatelist();
        $this->assign('header_cates',$header_cate);
    }
}
?>