protected function _initialize() { parent::_initialize(); if (!C('WEB_SITE_CLOSE')) { $this->error('站点已经关闭,请稍后访问~'); } }
protected function _initialize() { parent::_initialize(); $this->openuid = I('get.openuid'); if (getUidByOpenuid($this->openuid)) { $this->uid = getUidByOpenuid($this->openuid); } else { $this->error('您无权访问当前页面!'); } $this->assign('openuid', $this->openuid); //会员信息 $this->memberDetail = D('Home/User')->find($this->uid); //烘焙作品数 $this->hbworksnum = getCount('Works', array('userid' => $this->uid, 'type' => 1)); //随拍作品 $this->spworksnum = getCount('Copy', array('userid' => $this->uid)); //关注数 $this->attentionnum = getCount('UserFans', array('myid' => $this->uid)); //被关注数 $this->fansnum = getCount('UserFans', array('userid' => $this->uid)); //是否关注 $this->isfans = getCount('UserFans', array('myid' => $this->userid, 'userid' => $this->uid, 'status' => true)); //中间广告 $this->midad = parent::getAdvert(9, 1, 0, 1); }
protected function _initialize() { parent::_initialize(); //中间图片 $this->midad = $this->getAdvert(5, 1, 0, 1); //右侧广告 $this->rightad = parent::getAdvert(5, 3, 0, 1); }
protected function _initialize() { parent::_initialize(); $this->id = I('get.id', 0, 'intval'); $this->catid = I('get.catid', 0, 'intval'); $this->userid = service("Passport")->userid ?: 0; $this->groupid = service("Passport")->groupid; }
protected function _initialize() { parent::_initialize(); $config = cache('Config'); $this->appid = $config['wxappid']; $this->appsecret = $config['wxappsecret']; $this->get_user_openid(); }
protected function _initialize() { parent::_initialize(); //会员参数设置 $this->userConfig = array('qq_akey' => '', 'qq_skey' => '', 'defaultupoint' => 50, 'enablemailcheck' => true); $this->userDb = D('User/User'); //登陆检测 $this->check_user(); }
protected function _initialize() { parent::_initialize(); $uid = isset($_REQUEST['uid']) && ($_REQUEST['uid'] = intval($_REQUEST['uid'])) > 0 ? $_REQUEST['uid'] : is_login(); if (!$uid) { $this->error('需要登录'); } $this->assign('uid', $uid); $this->mid = is_login(); }
protected function _initialize() { parent::_initialize(); //当前导航 $this->assign('trynav', $this->getTryNav()); $this->cate = $this->tryCategory(); //更新状态,把过期的产品更新为过期 $arr['iffinish'] = true; $map['end_time'] = array('LT', time()); M('TryItems')->where($map)->save($arr); $data['iffinish'] = false; $where['end_time'] = array('GT', time()); M('TryItems')->where($where)->save($data); }
protected function _initialize() { //检查是否后台登录,后台登录下优先级最高,用于权限判断 if (\Admin\Service\User::getInstance()->id) { define('IN_ADMIN', true); $this->isadmin = 1; $this->upname = \Admin\Service\User::getInstance()->username; $this->upuserid = \Admin\Service\User::getInstance()->id; } else { $this->upname = service('Passport')->username; $this->upuserid = service('Passport')->userid; $this->groupid = service('Passport')->groupid ? service('Passport')->groupid : 8; } parent::_initialize(); }
protected function _initialize() { parent::_initialize(); $this->userid = service("Passport")->userid; $this->username = service("Passport")->usename; }
protected function _initialize() { define('APP_SUB_DOMAIN_NO', 1); parent::_initialize(); }
/** * 后台控制器初始化 */ protected function _initialize() { parent::_initialize(); $this->_adminInit(); }
protected function _initialize() { parent::_initialize(); }
protected function _initialize() { parent::_initialize(); $this->assign('nav', $this->getNav()); }
/** * 业务逻辑都放在 WeiboApi 中 * @var */ protected function _initialize() { parent::_initialize(); $tree = D('Issue')->getTree(); $this->assign('tree', $tree); }