<?php
/**
 * 网站首页
 * @Copyright (C) 2016 汉潮 All rights reserved.
 * @License http://www.hanchao9999.com
 * @Author xiaoq <570035208@qq.com>
 */

namespace Shop\Controller;
use Think\Controller;
class PurchaseController extends BaseController {
	public function _initialize(){
		parent::_initialize();
        if(!checksiteauth('GongHuoShang')){ exit;}
		$sess=session('shops_info');
		GLOBAL $PurchaseCategory;
        if(empty($PurchaseCategory))$PurchaseCategory=getcache('PurchaseCategory');
		
        $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);
		//该区域的供货商
		// $supplier_lists=getsuppliers($sess['shop_id']);
		// $this->assign('supplier_list',$supplier_lists);
		
		//获取购物车信息
		// $store_carts=D('Common/Stock')->cart_list();
		// $this->assign('cart_list',$store_carts);
        // $this->fetch('cart_list');
		$this->mendian();
		
    }
	//批发首页
	public function index(){
		$sess=session('shops_info');

		$this->display();
    }
}
?>