本文整理汇总了PHP中BaseAction类的典型用法代码示例。如果您正苦于以下问题:PHP BaseAction类的具体用法?PHP BaseAction怎么用?PHP BaseAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BaseAction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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();
}
示例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);
}
示例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));
}
}
}
示例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;
}
示例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'));
}
示例7: _initialize
public function _initialize()
{
parent::_initialize();
$where['token'] = $this->token;
$kefu = M('Kefu')->where($where)->find();
$this->assign('kefu', $kefu);
}
示例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);
}
示例9: __construct
public function __construct()
{
parent::__construct();
if (cookie('id') == null && cookie('username') == null) {
$this->success('你未登陆,请登录后再操作', U('Home/Index/index'));
}
}
示例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'];
//
}
示例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');
}
}
示例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);
}
示例13: __construct
/**
* 构造方法
*/
public function __construct()
{
parent::__construct();
//重写父类构造方法
//初始化
$this->_init();
}
示例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();
}
示例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';
}