本文整理匯總了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';
}