<?php
/**
 * 核销管理
 * @Copyright (C) 2016 汉潮 All rights reserved.
 * @License http://www.hanchao9999.com
 * @Author lss <lss@qq.com>
 */
namespace Shop\Controller;
use Think\Controller;
class HexiaoController extends BaseController{
    public function _initialize()
    {
        parent::_initialize();
        if(!checksiteauth('FuWu')){ exit;}
        $shops_info=session('shops_info');
        if(empty($shops_info['id']))$this->error('身份过期，请重新登录',U('Shop/Register/shop_login'));
		$this->mendian();
    }
	/**
     *门店服务核销
     */
	public function fw_hx(){
		$auth_code = 'hexiao_service';
		$ret=D('Shop/Shops')->shop_account_option($auth_code);
        if($ret['status']!=1) {$this->error($ret['msg']);}

		$this->assign('tplseo_title','服务核销'.'_'.C('WEB_SITE_TITLE'));
        $this->assign('page_title','服务核销');
		$this->display();
	}
	public function tc_hx(){
		$this->assign('tplseo_title','套餐核销'.'_'.C('WEB_SITE_TITLE'));
        $this->assign('page_title','套餐核销');
		$this->display();
	}
	public function jp_hx(){
		$auth_code = 'hexiao_gift';
		$ret=D('Shop/Shops')->shop_account_option($auth_code);
        if($ret['status']!=1) {$this->error($ret['msg']);}
        
		$shops_info=session('shops_info');
		$user_name = '';
		if($shops_info['pid'] > 0){
			$user_name = $shops_info['login_name'];
		}else{
			$user_name = $shops_info['account_name'];
		}
		$this->assign('tplseo_title','礼品核销'.'_'.C('WEB_SITE_TITLE'));
        $this->assign('page_title','礼品核销');
        $this->assign('user_name',$user_name);
        $this->assign('location_id',$shops_info['id']);
		$this->display();
	}
    public function thm(){
    	$auth_code = 'hexiao_thm';
		$ret=D('Shop/Shops')->shop_account_option($auth_code);
        if($ret['status']!=1) {$this->error($ret['msg']);}

		$this->assign('tplseo_title','提货码'.'_'.C('WEB_SITE_TITLE'));
        $this->assign('page_title','提货码');
		$this->assign('shop_id',MID);
		$this->display();
	}
}