本文整理汇总了PHP中WapAction::_initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP WapAction::_initialize方法的具体用法?PHP WapAction::_initialize怎么用?PHP WapAction::_initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WapAction
的用法示例。
在下文中一共展示了WapAction::_initialize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _initialize
public function _initialize(){
parent::_initialize();
$agent = $_SERVER['HTTP_USER_AGENT'];
if (!strpos($agent, "MicroMessenger")) {
//echo '此功能只能在微信浏览器中使用';exit;
}
$this->token = isset($_REQUEST['token']) ? $_REQUEST['token'] : session('token');//$this->_get('token');
$this->assign('token', $this->token);
$this->wecha_id = isset($_REQUEST['wecha_id']) ? $_REQUEST['wecha_id'] : '';
$this->assign('wecha_id', $this->wecha_id);
$this->_cid = $_SESSION["session_hotel_{$this->token}"];
$this->assign('cid', $this->_cid);
$this->session_dish_info = "session_hotel_{$this->_cid}_info_{$this->token}";
$this->session_dish_user = "session_hotel_{$this->_cid}_user_{$this->token}";
$this->assign('totalDishCount', $count);
$where['token']=$this->token;
$kefu=M('Kefu')->where($where)->find();
$this->assign('kefu',$kefu);
}
示例2: _initialize
public function _initialize()
{
parent::_initialize();
if (!$this->wecha_id) {
$this->error('您无权访问', '');
}
}
示例3: __construct
public function __construct()
{
parent::_initialize();
$this->action_id = $this->_get("id", "intval");
D("Userinfo")->convertFake(M("cointree_users"), array("token" => $this->token, "wecha_id" => $this->wecha_id, "fakeopenid" => $this->fakeopenid));
}
示例4: _initialize
public function _initialize()
{
parent::_initialize();
$agent = $_SERVER['HTTP_USER_AGENT'];
if (!strpos($agent, "MicroMessenger")) {
// echo '此功能只能在微信浏览器中使用';exit;
}
$this->token = isset($_REQUEST['token']) ? htmlspecialchars($_REQUEST['token']) : session('token');
$this->session_cart_name = 'session_cart_products_' . $this->token;
$this->assign('token', $this->token);
$this->wecha_id = isset($_REQUEST['wecha_id']) ? htmlspecialchars($_REQUEST['wecha_id']) : '';
if (!$this->wecha_id) {
//$this->wecha_id='';
//exit('非法请求');
}
$this->assign('wecha_id', $this->wecha_id);
$this->product_model = M('Product');
$this->product_cat_model = M('Product_cat');
$this->assign('staticFilePath', str_replace('./', '/', THEME_PATH . 'common/css/store'));
//购物车
$calCartInfo = $this->calCartInfo();
$this->assign('totalProductCount', $calCartInfo[0]);
$this->assign('totalProductFee', $calCartInfo[1]);
$cats = $this->product_cat_model->where(array('token' => $this->token))->order('id asc')->select();
$this->assign('cats', $cats);
}
示例5: _initialize
public function _initialize()
{
parent::_initialize();
$this->action_id = $this->_request('id', 'intval');
D('Userinfo')->convertFake(M('voteimg_users'), array('token' => $this->token, 'wecha_id' => $this->wecha_id, 'fakeopenid' => $this->fakeopenid));
}
示例6: __construct
public function __construct()
{
$this->bid = $this->_get('bid') ? intval($this->_get('bid', 'trim')) : 0;
parent::_initialize();
/*$checkFunc=new checkFunc();if (!function_exists('fdsrejsie3qklwewerzdagf4ds')){exit('error-4');}
$checkFunc->cfdwdgfds3skgfds3szsd3idsj();*/
if (!$this->wecha_id) {
$this->wecha_id = '';
$_SESSION['token_openid_' . $this->token] = '';
}
if ($this->owndomain) {
$this->siteUrl = "http://" . $this->owndomain;
}
$this->thisopenduser = $this->bid . '_user' . $this->wecha_id;
//$loginuserid=isset($_SESSION[$thisopenduser]) && !empty($_SESSION[$thisopenduser]) ? intval($_SESSION[$thisopenduser]) : 0;
$loginuserid = cookie($this->thisopenduser);
$this->loginuserid = $loginuserid ? intval($loginuserid) : 0;
$tmpuserid = $this->_get('loginuserid') ? intval($this->_get('loginuserid', 'trim')) : 0;
if ($this->owndomain && $this->rget == 3 && $tmpuserid > 0) {
$this->loginuserid = $tmpuserid;
}
$bgimg = $_SESSION['MicroBroker_bgimg' . $this->bid];
$this->assign('loginuserid', $this->loginuserid);
$this->assign('wecha_id', $this->wecha_id);
$this->assign('bid', $this->bid);
$this->assign('bgimg', $bgimg);
}
示例7: __construct
public function __construct()
{
parent::_initialize();
if (!defined('RES')) {
define('RES', THEME_PATH . 'common');
}
//$this->wecha_id=$this->wecha_id;
$this->assign('wecha_id', $this->wecha_id);
//
$this->token = $this->_get('token');
$this->thisUser = M('Userinfo')->where(array('token' => $this->_get('token'), 'wecha_id' => $this->wecha_id))->find();
if (!$this->wecha_id && ACTION_NAME != 'companyMap') {
$this->error('您没有权限使用会员卡,如需使用请关注微信“' . $this->wxuser['wxname'] . '”并回复会员卡', U('Index/index', array('token' => $this->token)));
}
$action = array('index', 'companyMap', 'payReturn');
if (!in_array(ACTION_NAME, $action) && empty($_GET['cardid'])) {
$this->error('请领取会员卡后再操作');
}
if (C('baidu_map')) {
$this->isamap = 0;
} else {
$this->isamap = 1;
$this->amap = new amap();
}
}
示例8: _initialize
public function _initialize()
{
parent::_initialize();
$this->fans = M("userinfo")->where(array("token" => $this->token, "wecha_id" => $this->wecha_id))->find();
if ($this->fans == "") {
}
$id = $this->_get("id", "intval");
$info = M("Collectword")->where(array("id" => $id, "token" => $this->token, "is_open" => 0))->find();
$this->info = $info;
$news_list = S($id . "Collectword" . $this->token . "news");
if ($news_list == "") {
$news_list = M("CollectwordNews")->where(array("token" => $this->token, "pid" => $id))->order("id")->select();
foreach ($news_list as $nk => $nv ) {
$news_list[$nk]["url"] = $this->getLink($nv["url"]);
}
S($id . "Collectword" . $this->token . "news", $news_list);
}
$prize_list = M("CollectwordPrize")->where(array("token" => $this->token, "pid" => $id))->order("id")->select();
if ("1" == $_GET["isjoin"]) {
if ($this->info["start"] < time()) {
M("CollectwordUser")->where(array("pid" => $id, "token" => $this->token, "wecha_id" => $this->wecha_id))->setField("is_join", "1");
}
else {
$this->error("活动尚未开始。");
}
}
$params["word"] = $this->info["word"];
$params["count"] = $prize_list[0]["num"];
$params["sCount"] = $params["count"] - M("CollectwordUser")->where(array("token" => $this->token, "pid" => $id, "is_prize" => "1"))->count();
$params["time"] = $this->info["end"] - time();
$params["expect"] = $this->info["expect"];
$this->collectword = new CollectWord($params);
$this->info["wordNum"] = $this->collectword->getLength();
$this->info["word"] = $this->collectword->getWord();
$this->assign("news_list", $news_list);
$this->assign("prize_list", $prize_list);
$this->info["fxtitle_d"] = strtr($this->info["fxtitle"], array("{{活动名称}}" => $this->info["title"]));
$this->info["fxinfo_d"] = strtr($this->info["fxinfo"], array("{{活动名称}}" => $this->info["title"]));
$this->info["fxtitle"] = strtr($this->info["fxtitle"], array("{{活动名称}}" => $this->info["title"], "{{字数}}" => count($this->_record())));
$this->info["fxinfo"] = strtr($this->info["fxinfo"], array("{{活动名称}}" => $this->info["title"], "{{字数}}" => count($this->_record())));
$this->info["prize_fxtitle"] = strtr($this->info["prize_fxtitle"], array("{{活动名称}}" => $this->info["title"], "{{奖品名称}}" => $prize_list[0]["title"]));
$this->info["prize_fxinfo"] = strtr($this->info["prize_fxinfo"], array("{{活动名称}}" => $this->info["title"], "{{奖品名称}}" => $prize_list[0]["title"]));
$this->info["reply_pic"] = (empty($this->info["fxpic"]) ? $this->info["reply_pic"] : $this->info["fxpic"]);
$replyPic = strstr($this->info["reply_pic"], "://");
if (empty($replyPic)) {
$this->info["reply_pic"] = C("site_url") . $this->info["reply_pic"];
}
$this->assign("info", $this->info);
}
示例9: _initialize
public function _initialize(){
parent::_initialize();
$agent = $_SERVER['HTTP_USER_AGENT'];
if(!strpos($agent,"MicroMessenger")) {
// echo '此功能只能在微信浏览器中使用';exit;
}
$this->token = $this->_get('token');
$this->session_cart_name='session_cart_products_'.$this->token;
$this->assign('token',$this->token);
$this->wecha_id = $this->wecha_id;
if (!$this->wecha_id){
//$this->wecha_id='';
}
$this->assign('wecha_id',$this->wecha_id);
$this->product_model=M('Product');
$this->product_cat_model=M('Product_cat');
//define('RES',THEME_PATH.'common');
//define('STATICS',TMPL_PATH.'static');
$this->assign('staticFilePath',str_replace('./','/',THEME_PATH.'common/css/product'));
//购物车
$calCartInfo=$this->calCartInfo();
$this->assign('totalProductCount',$calCartInfo[0]);
$this->assign('totalProductFee',$calCartInfo[1]);
//是否是餐饮
if (isset($_GET['dining'])&&intval($_GET['dining'])){
$this->isDining=1;
$this->assign('isDining',1);
}
}
示例10: _initialize
public function _initialize()
{
parent::_initialize();
$this->token = filter_var($this->_get('token'), FILTER_SANITIZE_STRING);
$this->wecha_id = filter_var($this->wecha_id, FILTER_SANITIZE_STRING);
$this->type = filter_var($this->_get('type'), FILTER_SANITIZE_STRING);
$this->bid = filter_var($this->_get('bid'), FILTER_VALIDATE_INT);
$arrAllow = array('fitness', 'gover', 'food', 'travel', 'flower', 'property', 'ktv', 'bar', 'fitment', 'wedding', 'affections', 'housekeeper', 'lease', 'beauty');
$orderid = filter_var($this->_get('orderid'), FILTER_SANITIZE_STRING);
if (!in_array($this->type, $arrAllow) && empty($_GET['orderid'])) {
$this->error('抱歉,您的参数不合法!', U('Index/index', array('token' => $this->token, 'wecha_id' => $this->wecha_id)));
}
$where = array('token' => $this->token, 'type' => $this->type, 'bid' => $this->bid);
$busines = M('busines')->where($where)->find();
$this->assign('busines', $busines);
$this->assign('picurl', $busines['picurl']);
$this->assign('title', $busines['title']);
$this->assign('token', $this->token);
$this->assign('wecha_id', $this->wecha_id);
$this->assign('type', $this->type);
$this->assign('bid', $this->bid);
$where['token'] = $this->token;
$kefu = M('Kefu')->where($where)->find();
$this->assign('kefu', $kefu);
$tpl = $this->wxuser;
$this->tpl = $tpl;
}
示例11: _initialize
public function _initialize()
{
parent::_initialize();
$this->action_id = $this->_get("id", "intval");
$this->my_packets = M("hongbao_grabber")->where("hongbao_id = $this->action_id and token = '$this->token' and grabber_wechaid = '$this->wecha_id'")->find();
}
示例12: _initialize
public function _initialize() {
parent::_initialize();
session('wapupload',1);
if (!$this->wecha_id){
$this->error('您无权访问','');
}
}
示例13: _initialize
protected function _initialize()
{
parent::_initialize();
$opened_funcs = session('opened_funcs_' . $this->token);
$cur_func = 'canyin';
if (!in_array($cur_func, $opened_funcs)) {
//Log::record('Dining function verification failed: token:'.$this->token.' opened_funcs:'.print_r($opened_funcs, true));
//Log::save();
echo '没有开启餐饮功能!';
exit;
}
if (empty($this->wechat_id)) {
//未登录
if ($this->wechat_type == 1 && $this->is_authed == 1) {
$host_name = C('wx_handler_server');
$cur_url = urlencode('http://' . $host_name . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'] . "#wechat_redirect");
//必须是认证过的服务号
$redirect = urlencode('http://' . $host_name . "/index.php?g=Wap&m=Oauth2&a=index&backurl=" . $cur_url . "#wechat_redirect");
$auth_url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" . $this->appid . "&redirect_uri=" . $redirect . "&response_type=code&scope=snsapi_userinfo&state=" . $this->token . "#wechat_redirect";
//Log::record('auth_url'.$auth_url);
header("Location:{$auth_url}");
//确保重定向后,后续代码不会被执行
}
}
$this->assign('token', $this->token);
}
示例14: __construct
public function __construct() {
$this->bid = $this->_get('bid') ? intval($this->_get('bid', 'trim')) : 0;
parent::_initialize();
if (!$this->wecha_id) {
$this->wecha_id = '';
$_SESSION['token_openid_' . $this->token] = '';
}
if($this->owndomain){
$this->siteUrl="http://".$this->owndomain;
}
$this->thisopenduser = $this->bid . '_user' . $this->wecha_id;
//$loginuserid=isset($_SESSION[$thisopenduser]) && !empty($_SESSION[$thisopenduser]) ? intval($_SESSION[$thisopenduser]) : 0;
$loginuserid = cookie($this->thisopenduser);
$this->loginuserid = $loginuserid ? intval($loginuserid) : 0;
$tmpuserid=$this->_get('loginuserid') ? intval($this->_get('loginuserid','trim')) : 0;
if($this->owndomain && ($this->rget==3) && ($tmpuserid>0)){
$this->loginuserid=$tmpuserid;
}
$bgimg=$_SESSION['MicroBroker_bgimg' . $this->bid];
$this->assign('loginuserid', $this->loginuserid);
$this->assign('wecha_id', $this->wecha_id);
$this->assign('bid', $this->bid);
$this->assign('bgimg', $bgimg);
}
示例15: __construct
public function __construct(){
parent::_initialize();
if (!defined('RES')){
define('RES',THEME_PATH.'common');
}
//$this->wecha_id=$this->wecha_id;
$this->assign('wecha_id',$this->wecha_id);
//
$this->token=$this->_get('token');
$this->thisUser = M('Userinfo')->where(array('token'=>$this->_get('token'),'wecha_id'=>$this->wecha_id))->find();
if (!$this->wecha_id && ACTION_NAME != 'companyMap'){
$name = $this->isFuwu ? '服务窗' : '微信';
$this->error('您没有权限使用会员卡,如需使用请关注'.$name.'“'.$this->wxuser['wxname'].'”并回复会员卡',U('Index/index',array('token'=>$this->token)));
}
$action = array('index', 'companyMap','payReturn');
if(!in_array(ACTION_NAME,$action) && empty($_GET['cardid'])){
$this->error('请领取会员卡后再操作');
}
if (C('baidu_map')){
$this->isamap=0;
}else {
$this->isamap=1;
$this->amap=new amap();
}
// 校正数据表
D('Userinfo')->convertFake(M('MemberCardCreate'), array('token'=>$this->token, 'fakeopenid'=> $this->fakeopenid, 'wecha_id'=>$this->wecha_id));
D('Userinfo')->convertFake(M('MemberCardCouponRecord'), array('token'=>$this->token, 'fakeopenid'=> $this->fakeopenid, 'wecha_id'=>$this->wecha_id));
D('Userinfo')->convertFake(M('MemberCardPayRecord'), array('token'=>$this->token, 'fakeopenid'=> $this->fakeopenid, 'wecha_id'=>$this->wecha_id));
D('Userinfo')->convertFake(M('MemberCardSign'), array('token'=>$this->token, 'fakeopenid'=> $this->fakeopenid, 'wecha_id'=>$this->wecha_id));
D('Userinfo')->convertFake(M('MemberCardUseRecord'), array('token'=>$this->token, 'fakeopenid'=> $this->fakeopenid, 'wecha_id'=>$this->wecha_id));
}