Ejemplo n.º 1
0
 public function _initialize()
 {
     parent::_initialize();
     $this->token = $this->_get('token');
     $this->wecha_id = $this->_get('wecha_id');
     $this->orderid = $this->_get('orderid');
     $this->order_db = M('product_cart');
     $this->order_list = M('product_cart_list');
     $order = M('product_cart')->where(array('orderid' => $this->orderid))->find();
     if ($order) {
         $order['ordername'] = "订单号:" . $order['orderid'];
         if ($order['dining'] == 1) {
             $this->orders_url = U('Dining/dingdan', array('token' => $this->token, 'wecha_id' => $this->wecha_id, 'storeid' => $order['storeid']));
         } else {
             $this->orders_url = U('Product/my', array('token' => $this->token, 'wecha_id' => $this->wecha_id, 'storeid' => $order['storeid']));
         }
         $this->order = $order;
     }
     //微信支付
     $pay_config = M('payment')->where(array('token' => $this->token, 'pay_code' => 'wxpay'))->find();
     $pay_config = unserialize($pay_config['pay_config']);
     $wxpay_config['appId'] = $pay_config['appId'];
     $wxpay_config['appKey'] = $pay_config['appKey'];
     $wxpay_config['appSecret'] = $pay_config['appSecret'];
     $wxpay_config['partnerId'] = $pay_config['partnerId'];
     $wxpay_config['partnerKey'] = $pay_config['partnerKey'];
     $this->wxpay_config = $wxpay_config;
 }
Ejemplo n.º 2
0
 protected function _initialize()
 {
     // dump(session('username'));die;
     // 统一使用member前缀,防止与原系统的混淆
     if (!isset($_SESSION['member_uid'])) {
         // echo $_SESSION['username'];die;
         $this->error('非法操作', U('PayMembers/Member/login'));
     }
     parent::_initialize();
     // if (C('USER_AUTH_ON') && !in_array(MODULE_NAME, explode(',', C('NOT_AUTH_MODULE')))) {
     // 	if (!RBAC::AccessDecision()) {
     // 		//检查认证识别号
     // 		if (!$_SESSION[C('USER_AUTH_KEY')]) {
     // 			//跳转到认证网关
     // 			redirect(PHP_FILE . C('USER_AUTH_GATEWAY'));
     // 		}
     // 		// 没有权限 抛出错误
     // 		if (C('RBAC_ERROR_PAGE')) {
     // 			// 定义权限错误页面
     // 			redirect(C('RBAC_ERROR_PAGE'));
     // 		} else {
     // 			if (C('GUEST_AUTH_ON')) {
     // 				$this->assign('jumpUrl', PHP_FILE . C('USER_AUTH_GATEWAY'));
     // 			}
     // 			// 提示错误信息
     // 			$this->error(L('_VALID_ACCESS_'));
     // 		}
     // 	}
     // }
     // $this->show_menu();
 }
Ejemplo n.º 3
0
 public function _initialize()
 {
     parent::_initialize();
     // 查找当前token店铺所属的帐号->所在的小区->的小区号->的第一个公众帐号的token
     $community_token = null;
     if (!empty($_GET['token'])) {
         //查找当前token所属的帐号
         $wxuser = M('Wxuser')->where(array('token' => $_GET['token']))->find();
         if (!empty($wxuser)) {
             //查找所属帐号
             $user = M('Users')->where(array('id' => $wxuser['uid']))->find();
             if (!empty($user)) {
                 // 查看用户所属小区的小区帐号
                 $user['community_id'];
                 $xq_user = M('Users')->where(array('community_id' => $user['community_id'], 'account_type' => 1))->find();
                 if (!empty($xq_user)) {
                     //查找该用户的所有公众号,并把第一个公众号作为小区公众号
                     $xq_wxusers = M('Wxuser')->where(array('uid' => $xq_user['id']))->select();
                     if (!empty($xq_wxusers)) {
                         $community_token = $xq_wxusers[0]['token'];
                     }
                 }
             }
         }
     }
     //读取公司信息
     $company = M('Company')->where(array('token' => $_GET['token']))->find();
     $this->assign('company', $company);
     $homeInfo = M('Home')->where(array('token' => $_GET['token']))->find();
     $this->assign('homeInfo', $homeInfo);
     $this->assign('community_token', $community_token);
 }
Ejemplo n.º 4
0
 public function _initialize()
 {
     parent::base();
     $this->group = D('Group');
     /*
      * 右侧信息
      */
     if (in_array(ACTION_NAME, array('find', 'search', 'add'))) {
         // 加入的圈子的数量
         $join_group_count = D('Member')->where('(level>1 AND status=1)  AND uid=' . $this->mid)->count();
         $this->assign('join_group_count', $join_group_count);
         // 热门标签
         $hot_tags_list = D('GroupTag')->getHotTags();
         $this->assign('hot_tags_list', $hot_tags_list);
         // 圈子热门排行
         $hot_group_list = $this->group->getHotList();
         $this->assign('hot_group_list', $hot_group_list);
     } else {
         if (in_array(ACTION_NAME, array('index', 'message', 'post', 'replied', 'comment', 'atme', 'bbsNotify'))) {
             //检查所有模板里面需要检查项
             $check['inIndex'] = in_array(ACTION_NAME, array('index', 'message'));
             $check['newly'] = $check['inIndex'] ? on : off;
             $check['postly'] = ACTION_NAME == 'post' ? "on" : "off";
             $check['replied'] = ACTION_NAME == "replied" ? "on" : "off";
             $check['commentes'] = ACTION_NAME == 'comment' ? "on" : "off";
             $check['bbsNotifyes'] = ACTION_NAME == 'bbsNotify' ? 'on' : "off";
             $check['atmes'] = ACTION_NAME == 'atme' ? 'on' : 'off';
             $this->assign($check);
             $this->assign('userCount', D('GroupUserCount', 'group')->getUnreadCount($this->mid));
         }
     }
 }
Ejemplo n.º 5
0
 public function run()
 {
     Yii::trace(get_class($this) . '.run()');
     $controller = parent::run();
     $json = isset($this->request->json) ? $this->request->json : false;
     $app_code = isset($this->request->appCode) ? $this->request->appCode : false;
     $app_version = isset($this->request->appVersion) ? $this->request->appVersion : false;
     if ($json && $app_code && $app_version) {
         //push type 1:push 2:screen
         $push_type = isset($json->type) ? $json->type : 1;
         //检查当前应用是否有推送任务
         $push_ids = DreamPushAppRelative::model()->checkPushStatus($app_code, $push_type);
         //获取当前有效的广告推送任务
         $push_ads = DreamPushTask::model()->getPushTasks($push_ids, $push_type);
         //get baidu cpd AD
         $uuid = isset($json->uuid) ? $json->uuid : false;
         $imei = isset($json->imei) ? $json->imei : false;
         if ($app_version >= 200) {
             if ($uuid || $imei) {
                 $push_ads = Util::getBaiduAd($uuid, $imei, $push_ads);
             }
         }
         if ($push_ads) {
             $this->response->push = array_values($push_ads);
         } else {
             $this->response->push = null;
         }
         return $this->response->code = 200;
     }
     return $this->response->code = 500;
 }
Ejemplo n.º 6
0
 public function __construct()
 {
     parent::__construct();
     $this->data['action_name'] = ACTION_NAME;
     $this->data['all_columns'] = D('CustomColumns')->getUserInfoModuleColumns();
     $this->data['recommend_columns'] = D('CustomColumns')->getUserRecommendModuleColumns();
     $this->data['status'] = $this->_get('status') ? $this->_get('status') : 'all';
     $this->data['list_views'] = D('CustomListViews')->getListView('UserInfo', $this->data['status']);
     $this->status_count = D('UserRecommends')->getStatusCountMap($this->login_user);
     $this->user_statuses = D('UserStatuses')->getStatusIdNameMap();
     foreach ($this->user_statuses as $key => $value) {
         $sub_types[$key] = $value . '(' . intval($this->status_count[$key]) . ')';
     }
     $sub_types['all'] = '所有(' . array_sum(array_values($this->status_count)) . ')';
     $this->sub_types = $sub_types;
     $this->data['selector'] = "user/" . ACTION_NAME;
     $this->audit_opinions = array(1 => '通过', 2 => '未通过进入备选', 3 => '待定');
     // sorry hack
     $this->all_audit_opinions = array(1 => array('name' => '通过', 'label-class' => 'success'), 2 => array('name' => '未通过', 'label-class' => 'important'), 3 => array('name' => '待定', 'label-class' => 'warning'), 4 => array('name' => '申请表驳回修改', 'label-class' => 'inverse'));
     $this->user_classify_xedit_str = json_encode_for_xedit(explode(',', D("Options")->getOption("user_classifies")));
     $this->could_edit = 1;
     $this->is_volunteer = $this->login_user['role'] == 'role_volunteer' ? 1 : 0;
     if ($this->is_volunteer) {
         $this->could_edit = 0;
     }
     $this->survey_users_xedit_str = json_encode_for_xedit(D("Users")->getField('id,realname'));
 }
Ejemplo n.º 7
0
 public function _initialize()
 {
     parent::_initialize();
     $where['token'] = $this->token;
     $kefu = M('Kefu')->where($where)->find();
     $this->assign('kefu', $kefu);
 }
Ejemplo n.º 8
0
 public function __construct()
 {
     parent::__construct();
     if (empty($this->user_session)) {
         $location_param = array();
         if ($_SERVER['HTTP_REFERER']) {
             $location_param['referer'] = urlencode($_SERVER['HTTP_REFERER']);
         }
         redirect(U('Login/index', $location_param));
     }
     $now_user = D('User')->get_user($this->user_session['uid']);
     if (empty($now_user)) {
         session('user', null);
         $this->error_tips('未获取到您的帐号信息,请重新登录!', U('Login/index'));
     }
     $now_user['now_money'] = floatval($now_user['now_money']);
     $this->now_user = $now_user;
     $this->assign('now_user', $now_user);
     $levelDb = M('User_level');
     $tmparr = $levelDb->where('22=22')->order('id ASC')->select();
     $levelarr = array();
     if ($tmparr) {
         foreach ($tmparr as $vv) {
             $levelarr[$vv['level']] = $vv;
         }
     }
     $this->user_level = $levelarr;
     unset($tmparr, $levelarr);
     $this->assign('levelarr', $this->user_level);
 }
 public function __construct()
 {
     parent::__construct();
     if (cookie('id') == null && cookie('username') == null) {
         $this->success('你未登陆,请登录后再操作', U('Home/Index/index'));
     }
 }
Ejemplo n.º 10
0
	public function _initialize() {
		parent::_initialize();
		$this->uid=intval($_GET['uid']);
		$this->gameConfig=M('Game_config')->where(array('uid'=>$this->uid))->find();
		$this->token=$this->gameConfig['token'];
		//
	}
Ejemplo n.º 11
0
 protected function _initialize()
 {
     parent::_initialize();
     $userinfo = M('User_group')->where(array('id' => session('gid')))->find();
     $users = M('Users')->where(array('id' => $_SESSION['uid']))->find();
     $this->assign('thisUser', $users);
     //dump($users);
     $this->assign('viptime', $users['viptime']);
     if (session('uid')) {
         if ($users['viptime'] < time()) {
             /*
             session(null);
             session_destroy();
             unset($_SESSION);
             */
             $_SESSION['gid'] = 1;
             $_SESSION['gname'] = "vip0";
             //$users['viptime'] = strtotime("+1 month");
             //$this->success('您的帐号已经到期,请充值后再使用');
         }
     }
     $wecha = M('Wxuser')->field('wxname,wxid,headerpic,weixin')->where(array('token' => session('token'), 'uid' => session('uid')))->find();
     $this->assign('wecha', $wecha);
     $this->assign('token', session('token'));
     $this->assign('userinfo', $userinfo);
     if (session('uid') == false) {
         $this->redirect('Home/Index/login');
     }
 }
Ejemplo n.º 12
0
	public function _initialize() {
		parent::_initialize();
        $this->_cid = isset($_GET['cid']) ? $this->_get('cid', 'trim,intval') : session('ycompany_id');
        $this->token = isset($_GET['token']) ? $this->_get('token', 'trim') : session('RepastStaff_token');
        $this->assign('token', $this->token);
        $this->assign('cid', $this->_cid);
    }
Ejemplo n.º 13
0
 /**
  * 构造方法
  */
 public function __construct()
 {
     parent::__construct();
     //重写父类构造方法
     //初始化
     $this->_init();
 }
Ejemplo n.º 14
0
 protected function _initialize()
 {
     $sql = 'SHOW COLUMNS FROM `' . C('DB_PREFIX') . 'user`';
     $COLUMNS = M()->query($sql);
     foreach ($COLUMNS as $vo) {
         $COLUMNS_array[] = $vo['Field'];
     }
     if (!in_array('is_admin', $COLUMNS_array)) {
         $sql = 'ALTER TABLE `' . C('DB_PREFIX') . 'user` ADD `is_admin` INT NOT NULL DEFAULT \'0\'';
         M()->query($sql);
     }
     if (!isset($_SESSION['username'])) {
         $this->error('非法操作', U('System/Admin/index'));
     }
     parent::_initialize();
     C('NOT_AUTH_ACTION', '');
     C('NOT_AUTH_MODULE', 'Admin');
     if (C('USER_AUTH_ON') && !in_array(MODULE_NAME, explode(',', C('NOT_AUTH_MODULE')))) {
         if (!RBAC::AccessDecision()) {
             if (!$_SESSION[C('USER_AUTH_KEY')]) {
                 redirect(PHP_FILE . C('USER_AUTH_GATEWAY'));
             }
             if (C('RBAC_ERROR_PAGE')) {
                 redirect(C('RBAC_ERROR_PAGE'));
             } else {
                 if (C('GUEST_AUTH_ON')) {
                     $this->assign('jumpUrl', PHP_FILE . C('USER_AUTH_GATEWAY'));
                 }
                 $this->error(L('_VALID_ACCESS_'));
             }
         }
     }
     $this->show_menu();
 }
Ejemplo n.º 15
0
 public function __construct()
 {
     parent::__construct();
     $this->data['all_columns'] = D('CustomColumns')->getSchoolModuleColumns($this->login_user['team_id'], $this->login_user['manage_group_ids']);
     $this->data['list_views'] = D('CustomListViews')->getListView('Schools');
     $this->data['selector'] = 'school/index';
 }
Ejemplo n.º 16
0
 protected function _initialize()
 {
     parent::_initialize();
     $userinfo = M('User_group')->where(array('id' => session('gid')))->find();
     $users = M('Users')->where(array('id' => $_SESSION['uid']))->find();
     $this->assign('thisUser', $users);
     //dump($users);
     $this->assign('viptime', $users['viptime']);
     if (session('uid')) {
         if ($users['viptime'] < time()) {
             session(null);
             session_destroy();
             unset($_SESSION);
             $this->error('您的帐号已经到期,请联系您的总代理。');
         }
     }
     $this->assign('userinfo', $userinfo);
     if (session('uid') == false) {
         $this->redirect('Home/Index/login');
     }
     $allfunction = M('Function')->where(array('belonguser' => session('belonguser')))->order('id')->select();
     $allfunctiontype = M('Function')->Distinct(true)->field('funtype')->where(array('belonguser' => session('belonguser'), 'funtype' => array('neq', '默认')))->order('usenum')->select();
     $this->assign('allfunction', $allfunction);
     $this->assign('allfunctiontype', $allfunctiontype);
     $where['uid'] = session('uid');
     $info = M('Wxuser')->where($where)->find();
     session('token', $info['token']);
     session('wxid', $info['id']);
     $wecha = M('Wxuser')->field('wxname,wxid,headerpic,weixin')->where(array('token' => session('token'), 'uid' => session('uid')))->find();
     $this->assign('wecha', $wecha);
     $this->assign('token', session('token'));
     //dump(session('token'));exit;
 }
Ejemplo n.º 17
0
 public function __construct()
 {
     parent::__construct();
     $this->store_id = isset($_REQUEST['store_id']) ? intval($_REQUEST['store_id']) : 0;
     $this->assign('store_id', $this->store_id);
     /* 粉丝行为分析 */
     D('Merchant_request')->add_request($this->mer_id, array('meal_hits' => 1));
     //店铺详情
     $merchant_store = M("Merchant_store")->where(array('store_id' => $this->store_id))->find();
     $merchant_store['office_time'] = unserialize($merchant_store['office_time']);
     $store_image_class = new store_image();
     $merchant_store['images'] = $store_image_class->get_allImage_by_path($merchant_store['pic_info']);
     $t = $merchant_store['images'];
     $merchant_store['image'] = array_shift($t);
     $merchant_store_meal = M("Merchant_store_meal")->where(array('store_id' => $this->store_id))->find();
     if ($merchant_store_meal) {
         $merchant_store = array_merge($merchant_store, $merchant_store_meal);
     }
     $this->leveloff = !empty($merchant_store_meal['leveloff']) ? unserialize($merchant_store_meal['leveloff']) : '';
     $this->_store = $merchant_store;
     $this->assign('store', $this->_store);
     $this->session_index = "session_foods{$this->store_id}_{$this->mer_id}";
     $this->order_index = "order_id_{$this->store_id}_{$this->mer_id}";
     if ($services = D('Customer_service')->where(array('mer_id' => $this->mer_id))->select()) {
         $key = $this->get_encrypt_key(array('app_id' => $this->config['im_appid'], 'openid' => $_SESSION['openid']), $this->config['im_appkey']);
         $kf_url = 'http://im-link.meihua.com/?app_id=' . $this->config['im_appid'] . '&openid=' . $_SESSION['openid'] . '&key=' . $key . '#serviceList_' . $this->mer_id;
         $this->assign('kf_url', $kf_url);
     }
 }
Ejemplo n.º 18
0
 public function __construct()
 {
     parent::__construct();
     $this->servers = array();
     $this->types = array();
     $this->title = "Servers list";
 }
Ejemplo n.º 19
0
	protected function _initialize(){		
		if(!isset($_SESSION['username'])){$this->error('非法操作',U('System/Adminsaivi/index'));}
		parent::_initialize();
		if (C('USER_AUTH_ON') && !in_array(MODULE_NAME, explode(',', C('NOT_AUTH_MODULE')))) {
            if (!RBAC::AccessDecision()) {
                //检查认证识别号
                if (!$_SESSION [C('USER_AUTH_KEY')]) {
                    //跳转到认证网关
                    redirect(PHP_FILE . C('USER_AUTH_GATEWAY'));
                }
                // 没有权限 抛出错误
                if (C('RBAC_ERROR_PAGE')) {
                    // 定义权限错误页面
                    redirect(C('RBAC_ERROR_PAGE'));
                } else {
                    if (C('GUEST_AUTH_ON')) {
                        $this->assign('jumpUrl', PHP_FILE . C('USER_AUTH_GATEWAY'));
                    }
                    // 提示错误信息
                    $this->error(L('_VALID_ACCESS_'));
                }
            }
        }
		$this->show_menu();
	}
Ejemplo n.º 20
0
 public function _initialize()
 {
     parent::_initialize();
     $this->member = D('Member');
     $this->assign('current', 'member');
     $this->setTitle("成员 - " . $this->groupinfo['name']);
 }
Ejemplo n.º 21
0
 public function _initialize()
 {
     parent::_initialize();
     $this->where = array('token' => $this->token);
     $this->modules = array('Home' => '首页', 'Classify' => '网站分类', 'Group' => '团购', 'Meal' => '订餐', 'Lottery' => '大转盘', 'Guajiang' => '刮刮卡', 'Coupon' => '优惠券', 'Card' => '会员卡', 'GoldenEgg' => '砸金蛋', 'LuckyFruit' => '水果机', 'Article' => '文章', 'Weidian' => '微店');
     $this->arr = array('game', 'Red_packet');
 }
Ejemplo n.º 22
0
 public function __construct()
 {
     parent::__construct();
     // 在此处加判断,如果是web 则用下述函数,如果是手机端,则另起一套身份难
     // TODO
     $this->check_auth();
 }
Ejemplo n.º 23
0
 function _initialize()
 {
     parent::_initialize();
     $this->video = D('V');
     $this->attach = D('Attach');
     $this->category = D('VideoType');
 }
Ejemplo n.º 24
0
 function _initialize()
 {
     parent::_initialize();
     $this->dao = M('Order');
     $user = M('User')->find($this->_userid);
     $this->assign('vo', $user);
 }
Ejemplo n.º 25
0
 public function __construct()
 {
     $this->data = "";
     $constraints = array();
     $constraints[] = new ActionConstraint('no_redirect', true);
     parent::__construct($constraints);
 }
Ejemplo n.º 26
0
	public function __construct(){

		parent::__construct();	
		$where['token']=$this->token;
		$kefu=M('Kefu')->where($where)->find();
		$this->assign('kefu',$kefu);
		$this->token=$this->_get('token');
		$this->wecha_id	= $this->_get('wecha_id');
		if (!$this->wecha_id){
			$this->wecha_id='null';
		}
		
		$this->user_id = $this->_get('uid');
		$this->diaoyan_id = $this->_get('id');
		$this->diaoyan=M('diaoyan');
		$this->diaoyan_timu=M('diaoyan_timu');
		$this->diaoyan_user=M('diaoyan_user');
		$this->urlarr =array(
			'token'=>$this->token, 
			'wecha_id'=> $this->wecha_id, 
			'id'=> $this->diaoyan_id,
			'uid'=> $this->user_id
		);
		
		$this->assign('token',$this->token);
		$this->assign('wecha_id',$this->wecha_id);
		$this->assign('urlarr',$this->urlarr);
		$this->assign('diaoyan_id',$this->diaoyan_id);
		
		
		
	}
Ejemplo n.º 27
0
	public function __construct()
	{
		parent::_initialize();
		$this->token = $this->_get('token');
		$this->wecha_id = $this->_get('wecha_id');

		if (!$this->token) {
			$this->token = $_SESSION['yeepay']['token'];
		}

		if (empty($_GET['platform'])) {
			$payConfig = M('Alipay_config')->where(array('token' => $this->token))->find();
			$payConfigInfo = unserialize($payConfig['info']);
			$this->payConfig = $payConfigInfo['yeepay'];

			if (empty($this->payConfig['open'])) {
				$payConfigInfo['merchantaccount'] = C('platform_yeepay_merchantaccount');
				$payConfigInfo['merchantPrivateKey'] = C('platform_yeepay_merchantPrivateKey');
				$payConfigInfo['merchantPublicKey'] = C('platform_yeepay_merchantPublicKey');
				$payConfigInfo['yeepayPublicKey'] = C('platform_yeepay_yeepayPublicKey');
				$payConfigInfo['product_catalog'] = C('platform_yeepay_product_catalog');
				$this->payConfig = $payConfigInfo;
			}
		}
		else {
			$payConfigInfo['merchantaccount'] = C('platform_yeepay_merchantaccount');
			$payConfigInfo['merchantPrivateKey'] = C('platform_yeepay_merchantPrivateKey');
			$payConfigInfo['merchantPublicKey'] = C('platform_yeepay_merchantPublicKey');
			$payConfigInfo['yeepayPublicKey'] = C('platform_yeepay_yeepayPublicKey');
			$payConfigInfo['product_catalog'] = C('platform_yeepay_product_catalog');
			$this->payConfig = $payConfigInfo;
		}
	}
Ejemplo n.º 28
0
 public function __construct()
 {
     parent::__construct();
     if (!$this->isLogged()) {
         header('location: login.php');
     }
 }
Ejemplo n.º 29
0
 public function __construct()
 {
     parent::_initialize();
     $this->token = $this->_get('token');
     $this->wecha_id = $this->wecha_id;
     if (!$this->token) {
         $product_cart_model = M('product_cart');
         $out_trade_no = $this->_get('out_trade_no');
         $order = $product_cart_model->where(array('orderid' => $out_trade_no))->find();
         if (!$order) {
             $order = $product_cart_model->where(array('id' => intval($this->_get('out_trade_no'))))->find();
         }
         $this->token = $order['token'];
     }
     $payConfig = M('Alipay_config')->where(array('token' => $this->token))->find();
     $payConfigInfo = unserialize($payConfig['info']);
     $this->payConfig = $payConfigInfo['weixin'];
     if (ACTION_NAME == 'pay' || ACTION_NAME == 'new_pay') {
         if (empty($this->payConfig['is_old'])) {
             $this->new_pay();
             exit;
         } else {
             $this->pay();
             exit;
         }
     }
 }
Ejemplo n.º 30
0
 public function __construct()
 {
     parent::__construct();
     $this->staff_session = session('staff_session');
     $this->staff_session = !empty($this->staff_session) ? unserialize($this->staff_session) : false;
     if (ACTION_NAME != 'login') {
         if (empty($this->staff_session) && $this->is_wexin_browser && !empty($_SESSION['openid'])) {
             $tmpstaff = D('Merchant_store_staff')->field(true)->where(array('openid' => trim($_SESSION['openid'])))->find();
             if (!empty($tmpstaff)) {
                 session('staff_session', serialize($tmpstaff));
                 $this->staff_session = $tmpstaff;
             }
         }
         if (empty($this->staff_session)) {
             redirect(U('Storestaff/login', array('referer' => urlencode('http://' . $_SERVER['HTTP_HOST'] . (!empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'])))));
             exit;
         } else {
             $this->assign('staff_session', $this->staff_session);
             $database_merchant_store = D('Merchant_store');
             $condition_merchant_store['store_id'] = $this->staff_session['store_id'];
             $this->store = $database_merchant_store->field(true)->where($condition_merchant_store)->find();
             if (empty($this->store)) {
                 $this->error_tips('店铺不存在!');
             }
         }
     }
     $this->assign('merchantstatic_path', $this->config['site_url'] . '/tpl/Merchant/static/');
 }