本文整理汇总了PHP中get_userinfo函数的典型用法代码示例。如果您正苦于以下问题:PHP get_userinfo函数的具体用法?PHP get_userinfo怎么用?PHP get_userinfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_userinfo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getGamesLuckyLists
function getGamesLuckyLists($gamesId, $uid = 0, $state = '-1', $aim_table = 'lottery_games')
{
$map['token'] = get_token();
$map['aim_table'] = $aim_table;
$map['draw_id'] = $gamesId;
if ($uid != 0) {
$map['follow_id'] = $uid;
}
if ($state != '-1') {
$map['state'] = $state;
}
$lists = $this->where($map)->order('id desc')->select();
$awardLists = D('Addons://Draw/LotteryGamesAwardLink')->getGamesAwardlists($gamesId);
foreach ($awardLists as $a) {
$awardData[$a['award_id']] = $a;
}
foreach ($lists as &$v) {
if ($awardData[$v['award_id']]) {
$v['grade'] = $awardData[$v['award_id']]['grade'];
$v['award_name'] = $awardData[$v['award_id']]['name'];
$v['img'] = $awardData[$v['award_id']]['img'];
}
$address_id = intval($v['address']);
if ($address_id) {
$address = D('Addons://Shop/Address')->getInfo($address_id);
$v['address'] = $address['address'];
$v['truename'] = $address['truename'];
$v['mobile'] = $address['mobile'];
}
$user = get_userinfo($v['follow_id']);
$v['nickname'] = $user['nickname'];
$v['headimgurl'] = $user['headimgurl'];
}
return $lists;
}
示例2: chat
public function chat()
{
$data = array();
if (is_login()) {
$uesr_info = get_userinfo();
$data['user_name'] = $uesr_info['user_name'];
$data['user_id'] = $uesr_info['user_id'];
}
$data['title'] = '聊天';
$this->assign($data);
$this->display('default/chat');
}
示例3: order
public function order()
{
if (IS_POST) {
if (!check_verify(I('verify'))) {
$this->error('验证码输入错误');
}
$Order = D('Order');
$order_id = 'NS' . date('YmdHis') . mt_rand(1000, 9999);
$uid = is_login();
$site_id = I('site_id', 0, 'intval');
if ($uid) {
$result = $Order->inputVisa($order_id, $uid, $site_id);
$mobile = get_userinfo($uid, 3);
} else {
$mobile = I('mobile', '', 'trim');
/* 调用注册接口注册用户 */
$User = new UserApi();
$res = $User->checkMobile($mobile);
if ($res == 1) {
$password = mt_rand(100000, 999999);
$uid = $User->register('', $password, '', $mobile);
if (0 < $uid) {
//注册成功
send_sms($mobile, array('mobile' => $mobile, 'password' => $password), 'password');
$result = $Order->inputVisa($order_id, $uid, $site_id);
}
} else {
$user_info = $User->getinfo($mobile, 3);
$result = $Order->inputVisa($order_id, $user_info[0], $site_id);
}
}
if ($result) {
send_sms($mobile, array('orderid' => $order_id), 'onOrder');
$this->redirect('checkOrder', array('order_id' => $order_id));
} else {
$this->error('订单提交失败');
}
} else {
$visa_id = I('visa_id', 0, 'intval');
if (empty($visa_id)) {
$this->error('无效参数');
}
// 线路信息
$map = array('visa_id' => $visa_id);
$visa_info = M('Visa')->where($map)->find();
if (empty($visa_info)) {
$this->error('不存在');
}
$this->assign('visa_info', $visa_info);
$this->display();
}
}
示例4: games_lucky_lists
function games_lucky_lists()
{
$this->assign('search_button', false);
$this->assign('add_button', false);
$this->assign('del_button', false);
$this->assign('check_all', false);
$gamesId = I('games_id', 0, 'intval');
$map['token'] = get_token();
$map['aim_table'] = 'lottery_games';
if ($gamesId) {
$map['draw_id'] = $gamesId;
}
$state = I('state');
if ($state != null) {
$map['state'] = $state;
}
session('common_condition', $map);
$model = $this->getModel('lucky_follow');
$list_data = $this->_get_model_list($model);
$gamesDao = D('Addons://Draw/Games');
$awardDao = D('Addons://Draw/LotteryGamesAwardLink');
$addressDao = D('Addons://Shop/Address');
foreach ($list_data['list_data'] as &$v) {
$awardLists = $awardDao->getGamesAwardlists($v['draw_id']);
foreach ($awardLists as $a) {
$awardData[$a['award_id']] = $a;
}
if ($awardData[$v['award_id']]) {
$awardId = $v['award_id'];
$v['award_id'] = $awardData[$awardId]['grade'];
$v['award_name'] = $awardData[$awardId]['name'];
}
$user = get_userinfo($v['follow_id']);
$v['follow_id'] = $user['nickname'];
$address_id = intval($v['address']);
if ($address_id) {
$address = $addressDao->getInfo($address_id);
$v['address'] = $address['address'];
$v['truename'] = $address['truename'];
$v['mobile'] = $address['mobile'];
}
$v['state'] = $v['state'] == 1 ? '已发奖' : '未发奖';
$gamesInfo = $gamesDao->getInfo($v['draw_id']);
$v['draw_id'] = $gamesInfo['title'];
}
$this->assign($list_data);
$this->display();
}
示例5: lists
function lists()
{
$isUser = get_userinfo($this->mid, 'manager_id');
if ($isUser) {
redirect(addons_url('BusinessCard://BusinessCard/edit'));
}
$this->assign('add_button', false);
$model = $this->getModel('BusinessCard');
$list_data = $this->_get_model_list($model);
foreach ($list_data['list_data'] as &$vo) {
// $url = U ( 'detail?uid=' . $vo ['uid'] );
$url = addons_url('BusinessCard://Wap/detail', array('uid' => $vo['uid']));
$vo['qrcode'] = "<img class='list_img' src='http://qr.liantu.com/api.php?text={$url}' />";
}
$this->assign($list_data);
$this->display();
}
示例6: lists
public function lists()
{
$this->assign('add_button', false);
$this->assign('search_button', false);
$this->assign('del_button', false);
$this->assign('check_all', false);
// 解析列表规则
$data = $this->_list_grid($this->model);
//dump ( $data );
$this->assign($data);
// 搜索条件
$map = $this->_search_map($this->model, $data['fields']);
$data['fields'][] = 'sum(score) as total';
$name = parse_name(get_table_name($this->model['id']), true);
$list = M($name)->where($map)->field($data['fields'])->order('id DESC')->group('uid')->selectPage();
foreach ($list['list_data'] as &$vo) {
$member = get_userinfo($vo['uid']);
$vo['truename'] = $member['truename'];
$vo['mobile'] = $member['mobile'];
$vo['score'] = $vo['total'];
}
$this->assign($list);
$this->display();
}
示例7: getMembershipData
function getMembershipData()
{
$map['uid'] = $this->mid;
$map['token'] = get_token();
$uid = I('uid');
$userExperience = get_userinfo($uid, 'experience');
$list = M('shop_membership')->where($map)->select();
foreach ($list as $v) {
if ($v['condition'] >= $userExperience) {
$extra .= $v['id'] . ':' . $v['membership'] . "\r\n";
}
}
return $extra;
}
示例8: getSession
public function getSession($params)
{
return $this->encodeOutput(get_userinfo());
}
示例9: get_html_userinfo
function get_html_userinfo($error_json_exit = false)
{
global $userinfo;
global $html_userinfo;
$html_userinfo = "No users found";
if (!get_userinfo($error_json_exit)) {
return false;
}
if (!count($userinfo)) {
return true;
}
$html_userinfo = "<table class='padcell'><tr><th>" . implode("</th><th>", array_keys($userinfo[0])) . "</th></tr>";
foreach ($userinfo as $k => $v) {
$html_userinfo .= "<tr><td>" . implode("</td><td> ", $v) . "</td></tr>";
}
$html_userinfo .= "</table>";
}
示例10: order
public function order()
{
if (IS_POST) {
if (!check_verify(I('verify'))) {
$this->error('验证码输入错误');
}
$Order = D('Order');
$order_id = 'NS' . date('YmdHis') . mt_rand(1000, 9999);
$uid = is_login();
$site_id = I('site_id', 0, 'intval');
if ($uid) {
$result = $Order->inputLine($order_id, $uid, $site_id);
$mobile = get_userinfo($uid, 3);
} else {
$mobile = I('mobile', '', 'trim');
/* 调用注册接口注册用户 */
$User = new UserApi();
$res = $User->checkMobile($mobile);
if ($res == 1) {
$password = mt_rand(100000, 999999);
$uid = $User->register('', $password, '', $mobile);
if (0 < $uid) {
//注册成功
send_sms($mobile, array('mobile' => $mobile, 'password' => $password), 'password');
$result = $Order->inputLine($order_id, $uid, $site_id);
}
} else {
$user_info = $User->getinfo($mobile, 3);
$result = $Order->inputLine($order_id, $user_info[0], $site_id);
}
}
if ($result) {
send_sms($mobile, array('orderid' => $order_id), 'onOrder');
$this->redirect('checkOrder', array('order_id' => $order_id));
} else {
$this->error('订单提交失败');
}
} else {
$line_id = I('line_id', 0, 'intval');
$tc_id = I('type_id', 0, 'intval');
$date = I('date', 0, 'strtotime');
if (empty($line_id) || empty($tc_id) || empty($date)) {
$this->error('无效参数');
}
// 线路信息
$line_info = M('Line')->find($line_id);
// 套餐信息
$map = array('line_id' => $line_id, 'end_time' => array('egt', strtotime('+' . $line_info['earlier_date'] . 'day')));
$line_tc = M('LineTc')->where($map)->select();
if (empty($line_tc)) {
$this->error('没有报价方案');
}
$tc_info = array();
foreach ($line_tc as $key => $value) {
if ($value['tc_id'] == $tc_id) {
$tc_info = $value;
break;
}
}
$ext_time = strtotime('+' . $line_info['earlier_date'] . 'day');
$tc_str = explode(',', $tc_info['date_price_data']);
foreach ($tc_str as $value) {
list($k, $val) = explode('|', $value);
$k = strtotime($k);
if ($k <= $ext_time) {
continue;
}
if ($k == $date) {
$tc_info['price_info'] = explode('-', $val);
$tc_info['price_info'][] = date('Y-m-d', $k);
break;
}
}
if (empty($tc_info['price_info'])) {
$this->error('没有价格');
}
$line_info['xingcheng'] = unserialize($line_info['xingcheng']);
$line_info['remark'] = unserialize($line_info['remark']);
$this->assign('line_info', $line_info);
$this->assign('line_tc', $line_tc);
$this->assign('tc_info', $tc_info);
$this->display();
}
}
示例11: _get_manager_menu
private function _get_manager_menu($uid, $addonList)
{
$menu_map['uid'] = $uid;
$menu_map['is_hide'] = 0;
$menus = $this->where($menu_map)->order('sort asc, id asc')->select();
// 没配置菜单时取默认的菜单
if (empty($menus)) {
$managerId = get_userinfo($uid, 'manager_id');
if ($managerId) {
$menu_map1['uid'] = $managerId;
$menus = $this->where($menu_map1)->order('sort asc, id asc')->select();
// 获取微商城id
$menu_map1['addon_name'] = 'Shop';
$shopAddonId = $this->where($menu_map1)->getField('id');
foreach ($menus as $k => $vo) {
if ($vo['title'] == '首页' || $vo['title'] == '微信管家') {
unset($menus[$k]);
}
// 屏蔽普通用户的栏目
if ($vo['pid'] == $shopAddonId && $vo['title'] == '支付配置') {
unset($menus[$k]);
}
if ($vo['pid'] == $shopAddonId && $vo['title'] == '功能配置') {
unset($menus[$k]);
}
}
} else {
$menu_map['uid'] = C('USER_ADMINISTRATOR');
$menus = $this->where($menu_map)->order('sort asc, id asc')->select();
}
}
// 侧边栏数据
foreach ($menus as $m) {
if ($m['menu_type'] == 0) {
continue;
}
$param['side'] = $cate['id'] = $m['id'];
$cate['title'] = $m['title'];
$param['top'] = $cate['pid'] = intval($m['pid']);
if ($m['url_type'] == 0) {
$cate['url'] = $addonList[$m['addon_name']]['addons_url'];
} elseif (strpos($m['url'], 'http://') !== false || strpos($m['url'], 'https://') !== false) {
$cate['url'] = $m['url'];
} elseif (strpos($m['url'], '://') !== false) {
$cate['url'] = addons_url($m['url']);
} else {
$cate['url'] = U($m['url']);
}
$cate['url'] .= '&mdm=' . $cate['pid'] . '|' . $cate['id'];
$cate['addon_name'] = $m['addon_name'];
$res['core_side_menu'][$cate['pid']][] = $cate;
$res['default_data'][$cate['url']] = $param;
empty($m['addon_name']) || ($res['default_data'][$cate['addon_name']] = $param);
}
// 顶部栏数据
foreach ($menus as $m) {
if ($m['menu_type'] != 0) {
continue;
}
$param['top'] = $cate['id'] = $m['id'];
$cate['title'] = $m['title'];
$cate['pid'] = 0;
if ($m['url_type'] == 0) {
$cate['url'] = $addonList[$m['addon_name']]['addons_url'];
if (empty($cate['url']) && !empty($res['core_side_menu'][$m['id']])) {
$cate['url'] = $res['core_side_menu'][$m['id']][0]['url'];
}
$cate['url'] .= '&mdm=' . $cate['id'];
} else {
if ($m['url_type'] == 0) {
$cate['url'] = $addonList[$m['addon_name']]['addons_url'];
} elseif (strpos($m['url'], 'http://') !== false || strpos($m['url'], 'https://') !== false) {
$cate['url'] = $m['url'];
} elseif (strpos($m['url'], '://') !== false) {
$cate['url'] = addons_url($m['url']);
} else {
$cate['url'] = U($m['url']);
}
if ($res['core_side_menu'][$m['id']][0]['id']) {
$cate['url'] .= '&mdm=' . $m['id'] . '|' . $res['core_side_menu'][$m['id']][0]['id'];
} else {
$cate['url'] .= '&mdm=' . $m['id'];
}
}
$cate['addon_name'] = $m['addon_name'];
$res['core_top_menu'][] = $cate;
$param['side'] = $res['core_side_menu'][$m['id']][0]['id'];
$res['default_data'][$cate['url']] = $param;
empty($m['addon_name']) || ($res['default_data'][$cate['addon_name']] = $param);
}
return $res;
}
示例12: show_log
function show_log()
{
$model = $this->getModel('shop_vote_log');
$param1['mdm'] = $param['mdm'] = $_GET['mdm'];
$vote_id = I('vote_id');
$vote_id && ($param['vote_id'] = $map['vote_id'] = $vote_id);
$opt_id = I('option_id');
$opt_id && ($param['option_id'] = $map['option_id'] = $opt_id);
$map['token'] = get_token();
$search_url = addons_url('Vote://ShopVote/show_log', $param);
$this->assign('search_url', $search_url);
$res['title'] = '投票活动';
$res['url'] = addons_url('Vote://ShopVote/lists', $param1);
$res['class'] = _ACTION == 'lists' ? 'current' : '';
$nav[] = $res;
$res['title'] = '投票记录';
$res['url'] = addons_url('Vote://ShopVote/show_log', $param);
$res['class'] = _ACTION == 'show_log' ? 'current' : '';
$nav[] = $res;
$this->assign('nav', $nav);
$this->assign('add_button', false);
$this->assign('del_button', false);
$this->assign('check_all', false);
$btn['url'] = U('option_lists', $param);
$btn['title'] = '返回';
$returnbtn[] = $btn;
$this->assign('top_more_button', $returnbtn);
$nickname = I('truename');
if ($nickname) {
$uidstr = D('Common/User')->searchUser($nickname);
if ($uidstr) {
$map['uid'] = array('in', $uidstr);
} else {
$map['uid'] = 0;
}
}
session('common_condition', $map);
// $shopVote=D('Addons://Vote/ShopVote')->getInfo($vote_id);
$list_data = $this->_get_model_list($model);
foreach ($list_data['list_data'] as &$vo) {
// $vo['vote_id']=$shopVote['title'];
$user = get_userinfo($vo['uid']);
$vo['vote_id'] = url_img_html($user['headimgurl']);
$vo['uid'] = $user['nickname'];
$shopOption = D('Addons://Vote/ShopVoteOption')->getInfo($vo['option_id']);
$vo['option_id'] = $shopOption['truename'];
}
$this->assign($list_data);
$this->display('lists');
}
示例13: initUser
private function initUser()
{
if (isset($_GET['is_stree'])) {
$suid = $user['uid'] = rand(1, 10000);
} else {
$uid = session('mid');
}
if (!$uid && $GLOBALS['is_wap']) {
$uid = get_uid_by_openid();
$uid > 0 && session('mid', $uid);
}
if (!$uid) {
$youke_uid = M('config')->where('name="FOLLOW_YOUKE_UID"')->getField('value') - 1;
$user['uid'] = $youke_uid;
M('config')->where('name="FOLLOW_YOUKE_UID"')->setField('value', $youke_uid);
session('mid', $youke_uid);
}
// 当前登录者
$GLOBALS['mid'] = $this->mid = intval($uid);
$myinfo = get_userinfo($this->mid);
$GLOBALS['myinfo'] = $myinfo;
// 当前访问对象的uid
$GLOBALS['uid'] = $this->uid = intval($_REQUEST['uid'] == 0 ? $this->mid : $_REQUEST['uid']);
$this->assign('mid', $this->mid);
// 登录者
$this->assign('uid', $this->uid);
// 访问对象
$this->assign('myinfo', $GLOBALS['myinfo']);
// 访问对象
}
示例14: profile
/**
* 修改密码提交
*
* @author huajie <banhuajie@163.com>
*/
public function profile()
{
if (!is_login()) {
$this->error('您还没有登陆', U('User/login'));
}
if (IS_POST) {
// 获取参数
$uid = is_login();
$password = I('post.old');
$repassword = I('post.repassword');
$data['password'] = I('post.password');
empty($password) && $this->error('请输入原密码');
empty($data['password']) && $this->error('请输入新密码');
empty($repassword) && $this->error('请输入确认密码');
if ($data['password'] !== $repassword) {
$this->error('您输入的新密码与确认密码不一致');
}
$isUser = get_userinfo($uid, 'manager_id');
if ($isUser) {
$data['login_password'] = $data['password'];
}
$res = D('Common/User')->updateUserFields($uid, $password, $data);
if ($res !== false) {
$this->success('修改密码成功!');
} else {
$this->error('修改密码失败!');
}
} else {
$this->display();
}
}
示例15: output
function output()
{
$model = $this->model;
$map['token'] = get_token();
$orders = D('Addons://Shop/Order')->where($map)->getFields('order_number,id');
$follows = M('public_follow')->where($map)->getFields('openid,uid');
$payStatus = I('get.pay_status');
if ($payStatus) {
if ($payStatus == 3) {
$map['status'] = 0;
} else {
$map['status'] = $payStatus;
}
}
$payType = I('get.pay_type');
if ($payType) {
$map['paytype'] = $payType;
}
$isPrice = I('get.is_price');
if ($isPrice) {
$minVal = I('get.min_value', 0, 'intval');
$maxVal = I('get.max_value', 0, 'intval');
if ($minVal && $maxVal) {
$minVal < $maxVal && ($map['price'] = array('between', array($minVal, $maxVal)));
$minVal > $maxVal && ($map['price'] = array('between', array($maxVal, $minVal)));
$minVal == $maxVal && ($map['price'] = $minVal);
} else {
if (!empty($minVal)) {
$map['price'] = array('egt', $minVal);
} else {
if (!empty($maxVal)) {
$map['price'] = array('elt', $maxVal);
}
}
}
}
$search = $_REQUEST['single_orderid'];
if ($search) {
$this->assign('search', $search);
$map['single_orderid'] = array('like', '%' . htmlspecialchars($search) . '%');
unset($_REQUEST['single_orderid']);
}
session('common_condition', $map);
$list_data = $this->_get_model_list($this->model);
foreach ($list_data['list_grids'] as $v) {
$titleArr[] = $v['title'];
}
$dataArr[] = $titleArr;
$paytypearr = array('Weixin' => '微信支付', 'Alipaytype' => '支付宝支付', 'Tenpay' => '财付通WAP支付', 'TenpayComputer' => '财付通支付', 'Quickpay' => '银联支付');
foreach ($list_data['list_data'] as &$vo) {
$vo['wecha_id'] = get_userinfo($follows[$vo['wecha_id']], 'nickname');
$vo['orderName'] = urldecode($vo['orderName']);
$vo['price'] = '¥' . wp_money_format($vo['price']);
$vo['status'] = $vo['status'] == 0 ? '未支付' : '已支付';
$vo['paytype'] = $paytypearr[$vo['paytype']];
$param['id'] = $orders[$vo['single_orderid']];
$vo['single_orderid'] = $vo['single_orderid'];
unset($vo['id']);
$dataArr[] = $vo;
}
outExcel($dataArr, $map['module']);
}