<?php
/**
 * 会员中心
 * @Copyright (C) 2016 汉潮 All rights reserved.
 * @License http://www.hanchao9999.com
 * @Author zhaoh <1070309178@qq.com>
 */

namespace Member\Controller;
use Think\Controller;
class IndexController extends BaseController {
	public function _initialize(){
		parent::_initialize ();
	}
	public function index(){
		$collectgoods=D('Common/Member')->get_collect_goods($map,'','',1,3);
		$join='';
		$collectshops=D('Common/Member')->get_collect_shops($map,$join,'',1,4);
		$data['goods']=$collectgoods['list'];
		$data['shops']=$collectshops['list'];
		$b_map['user_id']=MID;
		//积分总数
		$map['id']=$this->member_info['id'];
		$points=M('Member')->where($map)->field('points,usepoints')->find();
		$allpoints=$points['points']+$points['usepoints'];
		//活动代金券
		$b_map['bonus_type_id']=5;
		$h_bonu=M('MemberBonus')->where($b_map)->field('id')->count();
		$this->assign('allpoints',$allpoints);
		$this->assign('h_bonu',$h_bonu);
		$this->assign('data',$data);
		$postdata=I('param.');
		$this->assign($postdata);
		$postdata['uid']=MID;
		//待付款
		$no_pay=D('Common/OrderInfo')->all_order($postdata,'no_pay');
		$this->assign('no_pay',$no_pay);
		//待发货
		$no_ship=D('Common/OrderInfo')->all_order($postdata,'no_ship',1);
		$this->assign('no_ship',$no_ship);
		//待收货
		$yes_ship=D('Common/OrderInfo')->all_order($postdata,'yes_ship',1);
		$this->assign('yes_ship',$yes_ship);
		//待评价
		$no_comment=D('Common/OrderInfo')->all_order($postdata,'no_comment',1);
		$this->assign('no_comment',$no_comment);
		//推广二维码
		$code=D('Common/Member')->extension();
		$this->assign('imgurl',$code['img_url']);
        		$this->assign('tplseo_title', '会员中心_' . C('WEB_SITE_TITLE'));
		$this->display();
	}
}
?>