• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP BaseAction类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中BaseAction的典型用法代码示例。如果您正苦于以下问题:PHP BaseAction类的具体用法?PHP BaseAction怎么用?PHP BaseAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了BaseAction类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _initialize

 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;
 }
开发者ID:fengsmith1988,项目名称:weixin-1,代码行数:28,代码来源:WxpayAction.class.php


示例2: _initialize

 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();
 }
开发者ID:noikiy,项目名称:vsuninpay,代码行数:31,代码来源:Back2Action.class.php


示例3: _initialize

 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);
 }
开发者ID:fengsmith1988,项目名称:weixin-1,代码行数:32,代码来源:XiaoquAction.class.php


示例4: _initialize

 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));
         }
     }
 }
开发者ID:yang7hua,项目名称:hunshe,代码行数:32,代码来源:IndexAction.class.php


示例5: run

 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;
 }
开发者ID:wpp8909,项目名称:findzhibo,代码行数:31,代码来源:PushAction.php


示例6: __construct

 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'));
 }
开发者ID:Germey,项目名称:yinxingpm,代码行数:27,代码来源:UserAction.class.php


示例7: _initialize

 public function _initialize()
 {
     parent::_initialize();
     $where['token'] = $this->token;
     $kefu = M('Kefu')->where($where)->find();
     $this->assign('kefu', $kefu);
 }
开发者ID:liuguogen,项目名称:weixin,代码行数:7,代码来源:WuyeAction.class.php


示例8: __construct

 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);
 }
开发者ID:belerweb,项目名称:pigcms,代码行数:30,代码来源:MyAction.class.php


示例9: __construct

 public function __construct()
 {
     parent::__construct();
     if (cookie('id') == null && cookie('username') == null) {
         $this->success('你未登陆,请登录后再操作', U('Home/Index/index'));
     }
 }
开发者ID:xuyi5918,项目名称:ThinkPHPDistribution,代码行数:7,代码来源:CommonAction.class.php


示例10: _initialize

	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'];
		//
	}
开发者ID:kevicki,项目名称:pig,代码行数:7,代码来源:GameAction.class.php


示例11: _initialize

 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');
     }
 }
开发者ID:yakrsa,项目名称:football,代码行数:29,代码来源:UserAction.class.php


示例12: _initialize

	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);
    }
开发者ID:kevicki,项目名称:pig,代码行数:7,代码来源:RepastStaffAction.class.php


示例13: __construct

 /**
  * 构造方法
  */
 public function __construct()
 {
     parent::__construct();
     //重写父类构造方法
     //初始化
     $this->_init();
 }
开发者ID:cyndiWade,项目名称:xintuo,代码行数:10,代码来源:ApiBaseAction.class.php


示例14: _initialize

 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();
 }
开发者ID:hehekeke,项目名称:pigcms,代码行数:34,代码来源:BackAction.class.php


示例15: __construct

 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';
 }
开发者ID:Germey,项目名称:yinxingpm,代码行数:7,代码来源:SchoolAction.class.php


示例16: _initialize

 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;
 }
开发者ID:dlpc,项目名称:wxshoppingmall,代码行数:33,代码来源:UserAction.class.php


示例17: __construct

 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);
     }
 }
开发者ID:belerweb,项目名称:pigcms,代码行数:29,代码来源:FoodAction.class.php


示例18: __construct

 public function __construct()
 {
     parent::__construct();
     $this->servers = array();
     $this->types = array();
     $this->title = "Servers list";
 }
开发者ID:jordsti,项目名称:ark-dedi-web,代码行数:7,代码来源:ServersAction.php


示例19: _initialize

	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();
	}
开发者ID:royalwang,项目名称:saivi,代码行数:25,代码来源:BackAction.class.php


示例20: _initialize

 public function _initialize()
 {
     parent::_initialize();
     $this->member = D('Member');
     $this->assign('current', 'member');
     $this->setTitle("成员 - " . $this->groupinfo['name']);
 }
开发者ID:yang7hua,项目名称:hunshe,代码行数:7,代码来源:MemberAction.class.php



注:本文中的BaseAction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP BaseActiveRecordVersioned类代码示例发布时间:2022-05-23
下一篇:
PHP Base类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap