本文整理汇总了PHP中BaseAction::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseAction::__construct方法的具体用法?PHP BaseAction::__construct怎么用?PHP BaseAction::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseAction
的用法示例。
在下文中一共展示了BaseAction::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct();
if (empty($this->user_session)) {
$this->error_tips('请先进行登录!', U('Login/index'));
}
}
示例2: __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);
}
示例3: redirect
function __construct()
{
parent::__construct();
if (session('admin') == null) {
redirect(U('Index/index'));
}
}
示例4: __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';
}
示例5: __construct
public function __construct()
{
parent::__construct();
if (cookie('id') == null && cookie('username') == null) {
$this->success('你未登陆,请登录后再操作', U('Home/Index/index'));
}
}
示例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: __construct
public function __construct()
{
parent::__construct();
// 在此处加判断,如果是web 则用下述函数,如果是手机端,则另起一套身份难
// TODO
$this->check_auth();
}
示例8: __construct
public function __construct()
{
$this->data = "";
$constraints = array();
$constraints[] = new ActionConstraint('no_redirect', true);
parent::__construct($constraints);
}
示例9: __construct
public function __construct(){
parent::__construct();
$this->token=session('token');
$this->Huisuo_photo=M('huisuo_photo');
// $this->token = $this->_get('token');
$this->assign('token',$this->token);
$this->wecha_id = $this->_get('wecha_id');
if (!$this->wecha_id){
$this->wecha_id='null';
}
$this->assign('wecha_id',$this->wecha_id);
$this->Yuyue_model=M('yuyue');
$this->yuyue_order=M('yuyue_order');
$this->type='Huisuo';
$where['token']=$this->token;
$kefu=M('Kefu')->where($where)->find();
$this->assign('kefu',$kefu);
}
示例10: __construct
public function __construct(){
parent::__construct();
$where['token']=$this->token;
$kefu=M('Kefu')->where($where)->find();
$this->assign('kefu',$kefu);
$this->token=$this->_get('token');
$this->wecha_id = $this->_get('wecha_id');
if (!$this->wecha_id){
$this->wecha_id='null';
}
$this->user_id = $this->_get('uid');
$this->diaoyan_id = $this->_get('id');
$this->diaoyan=M('diaoyan');
$this->diaoyan_timu=M('diaoyan_timu');
$this->diaoyan_user=M('diaoyan_user');
$this->urlarr =array(
'token'=>$this->token,
'wecha_id'=> $this->wecha_id,
'id'=> $this->diaoyan_id,
'uid'=> $this->user_id
);
$this->assign('token',$this->token);
$this->assign('wecha_id',$this->wecha_id);
$this->assign('urlarr',$this->urlarr);
$this->assign('diaoyan_id',$this->diaoyan_id);
}
示例11: __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);
}
}
示例12: __construct
/**
* 构造方法
*/
public function __construct()
{
parent::__construct();
//重写父类构造方法
//初始化
$this->_init();
}
示例13: __construct
public function __construct()
{
parent::__construct();
if (!$this->isLogged()) {
header('location: login.php');
}
}
示例14: __construct
public function __construct()
{
parent::__construct();
$this->staff_session = session('staff_session');
$this->staff_session = !empty($this->staff_session) ? unserialize($this->staff_session) : false;
if (ACTION_NAME != 'login') {
if (empty($this->staff_session) && $this->is_wexin_browser && !empty($_SESSION['openid'])) {
$tmpstaff = D('Merchant_store_staff')->field(true)->where(array('openid' => trim($_SESSION['openid'])))->find();
if (!empty($tmpstaff)) {
session('staff_session', serialize($tmpstaff));
$this->staff_session = $tmpstaff;
}
}
if (empty($this->staff_session)) {
redirect(U('Storestaff/login', array('referer' => urlencode('http://' . $_SERVER['HTTP_HOST'] . (!empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'])))));
exit;
} else {
$this->assign('staff_session', $this->staff_session);
$database_merchant_store = D('Merchant_store');
$condition_merchant_store['store_id'] = $this->staff_session['store_id'];
$this->store = $database_merchant_store->field(true)->where($condition_merchant_store)->find();
if (empty($this->store)) {
$this->error_tips('店铺不存在!');
}
}
}
$this->assign('merchantstatic_path', $this->config['site_url'] . '/tpl/Merchant/static/');
}
示例15: __construct
public function __construct(){
parent::__construct();
$this->token=session('token');
// $this->token = $this->_get('token');
$this->assign('token',$this->token);
$this->wecha_id = $this->_get('wecha_id');
if (!$this->wecha_id){
$this->wecha_id='null';
}
$this->assign('wecha_id',$this->wecha_id);
$this->Yuyue_model=M('yuyue');
$this->yuyue_order=M('yuyue_order');
$this->type='Jiudian';
}