Inheritance: extends CommonAction
 public function _initialize() {
     parent::_initialize();
     $this->_mod = D('item');
     $this->_cate_mod = D('item_cate');
     $brandlist= $this->_brand=M('brandlist')->where('status=1')->order('ordid asc,id asc')->select();
     $this->assign('brandlist',$brandlist);
 }
 public function _initialize()
 {
     parent::_initialize();
     $this->assign('token', $this->token);
     //
     $this->canUseFunction('huiyuanka');
     //权限
     if ($this->token != $_GET['token']) {
         //$this->error('非法操作');
     }
     $this->wxuser_db = M("Wxuser");
     //获取所在组的开卡数量
     $thisWxUser = $this->wxuser_db->where(array('token' => $this->token))->find();
     $thisUser = $this->user;
     $thisGroup = $this->userGroup;
     $this->wxuser_db->where(array('token' => $this->token))->save(array('allcardnum' => $thisGroup['create_card_num']));
     //总数
     //if (!$thisUser['card_num']){
     $allcards = M('Member_card_create')->where(array('token' => $this->token))->select();
     $cardTotal = count($allcards);
     M('Users')->where(array('id' => $thisUser['id']))->save(array('card_num' => $cardTotal));
     M('Wxuser')->where(array('token' => $this->token))->save(array('yetcardnum' => $cardTotal));
     //}else {
     //$cardTotal=$thisUser['card_num'];
     //}
     //
     $can_cr_num = $thisWxUser['allcardnum'] - $cardTotal;
     if ($can_cr_num > 0) {
         $data['cardisok'] = 1;
     } else {
         $data['cardisok'] = 0;
     }
     $this->wxuser_db->where(array('uid' => session('uid'), 'token' => session('token')))->save($data);
     //
     $this->member_card_set_db = M('Member_card_set');
     //
     $id = intval($_GET['id']);
     if ($id) {
         $this->thisCard = $this->member_card_set_db->where(array('id' => $id))->find();
         if ($this->thisCard && $this->thisCard['token'] != $this->token) {
             $this->error('非法操作');
         }
         $this->assign('thisCard', $this->thisCard);
     }
     //transfer start
     $data = M('Member_card_create');
     $cardByToken = $this->member_card_set_db->where(array('token' => $this->token))->order('id ASC')->find();
     if ($cardByToken) {
         $data->where('token=\'' . $this->token . '\' AND cardid=0')->save(array('cardid' => $cardByToken['id']));
         M('Member_card_exchange')->where('token=\'' . $this->token . '\' AND cardid=0')->save(array('cardid' => $cardByToken['id']));
         M('Member_card_coupon')->where('token=\'' . $this->token . '\' AND cardid=0')->save(array('cardid' => $cardByToken['id']));
         M('Member_card_vip')->where('token=\'' . $this->token . '\' AND cardid=0')->save(array('cardid' => $cardByToken['id']));
         M('Member_card_integral')->where('token=\'' . $this->token . '\' AND cardid=0')->save(array('cardid' => $cardByToken['id']));
     }
     //$thisWxUser['wx_coupons'] 	= '1';
     $this->wxuser = $thisWxUser;
     //transfer end
     $type = $this->_get('type', 'intval');
     $this->assign('type', $type ? $type : 1);
 }
Beispiel #3
0
	public function _initialize() {
		parent::_initialize();
		//$this->canUseFunction('hotel');
		
		$this->_cid = isset($_GET['cid']) ? intval($_GET['cid']) : session('companyid');
		if (empty($this->token)) {
			$this->error('不合法的操作', U('Index/index'));
		}
		if (empty($this->_cid))  {
			$company = M('Company')->where(array('token' => $this->token, 'isbranch' => 0))->find();
			if ($company) {
				$this->_cid = $company['id'];
				//主店的k存session
				session('companyk', md5($this->_cid . session('uname')));
			} else {
				$this->error('您还没有添加您的商家信息',U('Company/index',array('token' => $this->token)));
			}
		} else {
			$k = session('companyk');
			$company = M('Company')->where(array('token' => $this->token, 'id' => $this->_cid))->find();
			if (empty($company)) {
				$this->error('非法操作', U('Hotels/index',array('token' => $this->token)));
			} else {
				$username = $company['isbranch'] ? $company['username'] : session('uname');
				if (md5($this->_cid . $username) != $k) {
					$this->error('非法操作', U('Hotels/index',array('token' => $this->token)));
				}
			}
		}
		$this->assign('ischild', session('companyLogin'));
		$this->assign('cid', $this->_cid);
	}
Beispiel #4
0
	public function _initialize() {
		parent::_initialize();

		$this->sign_conf = M('sign_conf');
		$this->sign_db   = M('sign_in');

	}
	public function _initialize() {
		parent::_initialize();
		$this->token=$this->_session('token');
		$this->home_db=M('home');
		
		$this->canUseFunction('shouye');
	}
Beispiel #6
0
 public function _initialize()
 {
     parent::_initialize();
     $this->token = $this->_session('token');
     $this->kefu_db = M('kefu');
     $this->canUseFunction('Kefu');
 }
 protected function _initialize()
 {
     $this->function = 'car';
     $this->token = $_SESSION['token'];
     parent::_initialize();
     parent::checkOpenedFunction();
 }
Beispiel #8
0
 protected function prepareData()
 {
     parent::prepareData();
     $em = $this->em();
     $attachmentOwnerType = $em->getRepository('\\ru\\nazarov\\crm\\entities\\AttachmentType')->findOneBy(array('code' => 'application'));
     $attachments = array();
     foreach ($em->getRepository('\\ru\\nazarov\\crm\\entities\\Attachment')->findBy(array('type' => $attachmentOwnerType)) as $attachment) {
         $ownerId = $attachment->getOwner();
         if (!array_key_exists($ownerId, $attachments)) {
             $attachments[$ownerId] = array();
         }
         $attachments[$ownerId][] = $attachment;
     }
     $orgs = $em->getRepository('\\ru\\nazarov\\crm\\entities\\Organization')->findBy(array(), array('typeId' => 'ASC', 'name' => 'ASC'));
     $orgId = $this->request()->get('org');
     foreach ($orgs as $org) {
         if ($org->getId() == $orgId) {
             break;
         }
     }
     if (isset($org) && $org->getId() != $orgId) {
         $org = null;
     }
     $repo = $em->getRepository('\\ru\\nazarov\\crm\\entities\\Application');
     $this->view()->set('content', 'apps_list.tpl')->set('apps', isset($org) ? $repo->findBy(array($org->getType()->getCode() => $org->getId()), array('id' => 'DESC')) : $repo->findBy(array(), array('id' => 'DESC')))->set('attachments', $attachments)->set('orgId', isset($org) ? $org->getId() : null)->set('orgs', $orgs);
 }
 public function _initialize()
 {
     parent::_initialize();
     $this->canUseFunction("Yundabao");
     //加载数据库
     $this->m_wxuser = M("wxuser");
     $this->m_users = M("yundabao_users");
     $this->m_yundabao = M("yundabao");
     /**
      *API的url
      */
     //获取AccessToken的url
     $url['AccessToken'] = "http://openapi.yundabao.com/api/mode3api.ashx?action=AgentUserLogin";
     //获取UserId的url
     $url['UserId'] = "http://openapi.yundabao.com/api/mode3api.ashx?action=AgentUserId";
     //获取价格年限的url
     $url['PriceYears'] = "http://openapi.yundabao.com/api/mode3api.ashx?action=ServiceList&accesstoken=";
     //创建应用url
     $url['CreateApp'] = "http://openapi.yundabao.com/api/mode3api.ashx?action=CreateApp";
     //应用列表url
     $url['AppList'] = "http://openapi.yundabao.com/api/mode3api.ashx?action=AppList";
     //修改应用url
     $url['ModifyApp'] = "http://openapi.yundabao.com/api/mode3api.ashx?action=ModifyApp";
     //重新生成url
     $url['RebuildApp'] = "http://openapi.yundabao.com/api/mode3api.ashx?action=RebuildApp";
     //删除应用url
     $url['DeleteApp'] = "http://openapi.yundabao.com/api/mode3api.ashx?action=DeleteApp";
     //应用数据url
     $url['DataStatistics'] = "http://openapi.yundabao.com/api/mode3api.ashx?action=DataStatistics";
     //把url赋值给变量apiurl
     $this->apiurl = $url;
 }
	public function _initialize() {
		parent::_initialize();
		$this->pay_config_db=M('Alipay_config');
		if (!$this->token){
			exit();
		}
	}
Beispiel #11
0
 public function _initialize()
 {
     parent::_initialize();
     /*$checkFunc=new checkFunc();if (!function_exists('fdsrejsie3qklwewerzdagf4ds')){exit('error-4');}
       $checkFunc->cfdwdgfds3skgfds3szsd3idsj();*/
     $this->canUseFunction("Unitary");
 }
 public function _initialize()
 {
     parent::_initialize();
     if (ALI_FUWU_GROUP) {
         $isgostr = '只有认证的服务号或者服务窗才可以使用!';
     } else {
         $isgostr = '只有认证的服务号才可以使用!';
     }
     $this->isgostr = $isgostr;
     $this->assign('isgostr', $this->isgostr);
     if (intval($this->wxuser['winxintype']) != 3 && $this->wxuser['fuwuappid'] == '') {
         $this->error($isgostr);
         exit;
     }
     $where = array('token' => $this->token);
     $this->thisWxUser = M('Wxuser')->where($where)->find();
     if ($this->thisWxUser['type'] == 0) {
         $diyApiConfig = M('Diymen_set')->where($where)->find();
         if ((empty($this->thisWxUser['appid']) || empty($this->thisWxUser['appsecret'])) && (empty($diyApiConfig['appid']) || empty($diyApiConfig['appsecret']))) {
             $this->error('请先设置AppID和AppSecret再使用本功能', '?g=User&m=Index&a=edit&id=' . $this->thisWxUser['id']);
         } else {
             $this->thisWxUser['appid'] = $diyApiConfig['appid'];
             $this->thisWxUser['appsecret'] = $diyApiConfig['appsecret'];
         }
     }
     $apiOauth = new apiOauth();
     $this->access_token = $apiOauth->update_authorizer_access_token($this->thisWxUser['appid']);
 }
 public function _initialize()
 {
     parent::_initialize();
     $this->canUseFunction('Person_card');
     if ($this->token != $this->_get('token')) {
     }
 }
	public function _initialize() {
		parent::_initialize();
		$this->deliemail_config=M('deliemail');
		if (!$this->token){
			exit();
		}
	}
Beispiel #15
0
 public function _initialize()
 {
     parent::_initialize();
     $this->where = array('token' => $this->token);
     $this->modules = array('Home' => '首页', 'Classify' => '网站分类', 'Img' => '图文回复', 'Company' => 'LBS信息', 'Live' => '微场景', 'Adma' => 'DIY宣传页', 'Photo' => '相册', 'Selfform' => '万能表单', 'Custom' => '微预约', 'Host' => '商家订单', 'Groupon' => '团购', 'Shop' => '商城', 'Repast' => '订餐', 'Wedding' => '婚庆喜帖', 'Vote' => '投票', 'Paper' => '小秘书', 'Panorama' => '全景', 'Lottery' => '大转盘', 'Guajiang' => '刮刮卡', 'Coupon' => '优惠券', 'MemberCard' => '会员卡', 'Estate' => '微房产', 'Message' => '留言板', 'Car' => '汽车', 'GoldenEgg' => '砸金蛋', 'LuckyFruit' => '水果机', 'AppleGame' => '走鹊桥', 'Lovers' => '摁死情侣', 'Autumn' => '吃月饼', 'Problem' => '一战到底', 'Forum' => '论坛', 'GreetingCard' => '贺卡', 'Medical' => '微医疗', 'School' => '微教育', 'Hotels' => '酒店宾馆', 'Business' => '行业应用', 'Market' => '微商圈', 'Research' => '微调研', 'Fansign' => '微信签到', 'Vcard' => '微名片', 'OutsideLink' => '<font color="red">生活服务</font>');
     $this->arr = array('game');
 }
Beispiel #16
0
	public function _initialize() {

		parent::_initialize();

		$token_open=M('token_open')->field('queryname')->where(array('token'=>session('token')))->find();

		if(!strpos($token_open['queryname'],'Fenlei')){

            	$this->error('您还开启该模块的使用权,请到功能模块中添加',U('Function/index',array('token'=>session('token'),'id'=>session('wxid'))));

		}



		$this->Fenlei_model=M('Fenlei');


		$this->token=session('token');

		$this->assign('token',$this->token);

		$this->assign('module','Fenlei');


	}
Beispiel #17
0
 public function _initialize()
 {
     parent::_initialize();
     $this->canUseFunction('Fuwu');
     $this->appid = M('Wxuser')->where(array('token' => $this->token))->getField('fuwuappid');
     $this->m_fuwuuser = M('fuwuuser');
 }
Beispiel #18
0
 public function _initialize()
 {
     parent::_initialize();
     $this->canUseFunction('Dxs');
     $this->token = session('token');
     $this->assign('token', $this->token);
 }
Beispiel #19
0
	public function _initialize() {
		parent::_initialize();
		$this->token=session('token');
		$this->assign('token',$this->token);
		$this->apikey=C('baidu_map_api');
		$this->assign('apikey',$this->apikey);
	}
 public function _initialize()
 {
     parent::_initialize();
     $this->token = $this->_session('token');
     $this->home_db = M('home');
     $this->back_db = D('Background');
 }
 public function _initialize()
 {
     parent::_initialize();
     $this->token = $this->_session('token');
     $this->jiejing_db = M('Jiejing');
     $this->canUseFunction('Jiejing');
 }
Beispiel #22
0
	public function _initialize() {
		parent::_initialize();
		$function=M('Function')->where(array('funname'=>'wedding'))->find();
		if (intval($this->user['gid'])<intval($function['gid'])){
			$this->error('您还开启该模块的使用权,请到功能模块中添加',U('Function/index',array('token'=>$this->token)));
		}
	}
	public function _initialize() {
		parent::_initialize();
		$this->token='yicms';
		$where=array('token'=>$this->token);
		$this->thisWxUser=M('Wxuser')->where($where)->find();
		if (!$this->thisWxUser['appid']||!$this->thisWxUser['appsecret']){
			$this->error('请先设置AppID和AppSecret再使用本功能,谢谢','?g=User&m=Index&a=edit&id='.$this->thisWxUser['id']);
		}
		if ($this->thisWxUser['winxintype']!=3){
			//$this->error('只有微信官方认证的高级服务号才能使用本功能','?g=User&m=Index&a=edit&id='.$this->thisWxUser['id']);
		}
		$this->modules=array(
		'home'=>array('name'=>'微网站'),
		'text'=>array('name'=>'文本请求'),
		'member_card_set'=>array('name'=>'会员卡'),
		'lottery'=>array('name'=>'推广活动'),
		'help'=>array('name'=>'帮助'),
		'wedding'=>array('name'=>'婚庆喜帖'),
		'img'=>array('name'=>'图文消息'),
		'selfform'=>array('name'=>'万能表单'),
		'host'=>array('name'=>'通用订单'),
		'panorama'=>array('name'=>'全景'),
		'usernamecheck'=>array('name'=>'账号审核'),
		'album'=>array('name'=>'相册'),
		'vote'=>array('name'=>'投票'),
		'product'=>array('name'=>'商城'),
		'voiceresponse'=>array('name'=>'语音消息'),
		'estate'=>array('name'=>'房产'),
		);
	}
Beispiel #24
0
 public function execute()
 {
     $action = UserAction::newFromContext($this->getContext());
     $action->doAction();
     $this->setAction($action);
     $this->content = $this->initContent();
 }
Beispiel #25
0
 public function _initialize()
 {
     parent::_initialize();
     $type = 'Seckill';
     $this->assign('type', $type);
     $this->canUseFunction($type);
 }
Beispiel #26
0
 public function _initialize()
 {
     parent::_initialize();
     $this->card = new card($this->token);
     $this->cats = $this->card->cardCats();
     $this->assign('cats', $this->cats);
 }
 public function _initialize()
 {
     parent::_initialize();
     //
     $this->canUseFunction('advanceTpl');
     header('Location:/cms/manage/index.php');
 }
Beispiel #28
0
	public function _initialize() {

		parent::_initialize();

		$this->canUseFunction('Yiliao');



		$this->Yuyue_model=M('yuyue');

		$this->yuyue_order=M('yuyue_order');

		//$this->selfform_input_model=M('Selfform_input');

		//$this->selfform_value_model=M('Selfform_value');

		$this->token=session('token');

		$this->assign('token',$this->token);

		$this->assign('module','Yuyue');

		$this->type="Yiliao";

		//dump($_SESSION);die;

	}
	public function _initialize() {
		parent::_initialize();
		$this->reply_info_model=M('reply_info');
		$this->token=session('token');
		$this->assign('token',$this->token);
		//
		$this->infoTypes=array(
		'Groupon'=>array('type'=>'Groupon','name'=>'团购','keyword'=>'团购','url'=>U('Wap/Groupon/grouponIndex',array('token'=>$this->token))),
		'Dining'=>array('type'=>'Dining','name'=>'订餐','keyword'=>'订餐','url'=>U('Wap/Dining/index',array('token'=>$this->token))),
		'Zuche'=>array('type'=>'Zuche','name'=>'租车','keyword'=>'租车','url'=>U('Wap/Zuche/index',array('token'=>$this->token))),
		'Shop'=>array('type'=>'Shop','name'=>'商城','keyword'=>'商城','url'=>U('Wap/Product/index',array('token'=>$this->token))),
		'panorama'=>array('type'=>'panorama','name'=>'全景','keyword'=>'全景','url'=>U('Wap/Panorama/index',array('token'=>$this->token))),
		'Liuyan'=>array('type'=>'Liuyan','name'=>'留言','keyword'=>'留言','url'=>U('Wap/Liuyan/index',array('token'=>$this->token))),
		'Scoregift'=>array('type'=>'Scoregift','name'=>'积分换礼','keyword'=>'积分换礼','url'=>U('Wap/Scoregift/index',array('token'=>$this->token))),
		);
		//是否是餐饮
		if (isset($_GET['infotype'])&&$_GET['infotype']=='Dining'){
			$this->isDining=1;
		}else {
			$this->isDining=0;
		}
		//是否是租车
		if (isset($_GET['infotype'])&&$_GET['infotype']=='Zuche'){
			$this->iszuche=1;
			$this->assign('iszuche',$this->iszuche);
		}
		$this->assign('isDining',$this->isDining);
	}
Beispiel #30
0
 public function _initialize()
 {
     parent::_initialize();
     $this->where = array('token' => $this->token);
     $this->modules = array('Home' => '首页', 'Classify' => '网站分类', 'Img' => '图文回复', 'Company' => 'LBS信息', 'Live' => '微场景', 'Adma' => 'DIY宣传页', 'Photo' => '相册', 'Selfform' => '万能表单', 'Custom' => '通用表单', 'Host' => '商家订单', 'Groupon' => '团购', 'Shop' => '商城', 'sc1' => '微商城', 'sc2' => '微团购', 'sc3' => '微秒杀', 'Repast' => '订餐', 'Wedding' => '婚庆喜帖', 'Vote' => '投票', 'Paper' => '小秘书', 'Panorama' => '全景', 'Lottery' => '大转盘', 'Guajiang' => '刮刮卡', 'Coupon' => '优惠券', 'MemberCard' => '会员卡', 'Estate' => '微房产', 'Message' => '留言板', 'Car' => '汽车', 'GoldenEgg' => '砸金蛋', 'LuckyFruit' => '水果机', 'AppleGame' => '走鹊桥', 'Lovers' => '摁死情侣', 'Autumn' => '吃月饼', 'Problem' => '一战到底', 'Forum' => '论坛', 'GreetingCard' => '贺卡', 'Medical' => '微医疗', 'School' => '微教育', 'Hotels' => '酒店宾馆', 'Business' => '行业应用', 'Market' => '微商圈', 'Research' => '微调研', 'Fansign' => '微信签到', 'Zhaopin' => '微招聘', 'Fangchan' => '微房产', 'Baoming' => '报名活动', 'Sharetalent' => '分享达人', 'Hforward' => '转发有礼', 'Punish' => '惩罚台', 'Vcard' => '微名片', 'Jiejing' => '微街景', 'Yingyong' => '场景应用', 'OutsideLink' => '<font color="red">生活服务</font>');
     $this->arr = array('game', 'Knwx', 'Jingcai', 'Jiugong', 'Fanyan', 'Invite', 'Hforward', 'Lapiao', 'Jikedati', 'Sharetalent', 'Red_packet', 'Autumns', 'Popularity', 'Helping', 'MicroBroker', 'Seckill', 'Unitary', 'Crowdfunding', 'DishOut', 'LivingCircle', 'Test', 'Bargain', 'Service', 'Hongbao', 'Micrstore', 'SeniorScene', 'SeniorCard', 'ServiceChat', 'Voteimg');
 }