Beispiel #1
0
 /**
  * 获取用户信息
  *
  * @return array
  * @author Medz Seven <*****@*****.**>
  **/
 public function getUserInfo()
 {
     $uid = intval($_REQUEST['uid']);
     if (!$uid) {
         $this->error(array('status' => '-1', 'msg' => '没有传入UID'));
     } elseif (!($user = model('User')->getUserInfo($uid))) {
         $this->error(array('status' => '-2', 'msg' => '用户不存在'));
     }
     return array('status' => '1', 'uname' => $user['uname'], 'remark' => $user['remark'], 'avatar' => $user['avatar_original'], 'intro' => $user['intro'] ? formatEmoji(false, $user['intro']) : '');
 }
 /**
  * 获取评论列表,API使用
  * @param string $where 查询条件
  * @param integer $since_id 主键起始ID,默认为0
  * @param integer $max_id 主键最大ID,默认为0
  * @param integer $limit 每页结果集数目,默认为20
  * @param integer $page 页数,默认为1
  * @param boolean $source 是否获取资源信息,默认为false
  * @return array 评论列表数据
  */
 public function getCommentListForApi($where = '', $since_id = 0, $max_id = 0, $limit = 20, $page = 1, $source = false)
 {
     $since_id = intval($since_id);
     $max_id = intval($max_id);
     $limit = intval($limit);
     $page = intval($page);
     $where = empty($where) ? " is_del = 0 " : $where . ' AND is_del=0';
     if (!empty($since_id) || !empty($max_id)) {
         !empty($since_id) && ($where .= " AND comment_id > {$since_id}");
         !empty($max_id) && ($where .= " AND comment_id < {$max_id}");
     }
     $start = ($page - 1) * $limit;
     $end = $limit;
     $data = $this->where($where)->order('comment_id DESC')->limit("{$start}, {$end}")->findAll();
     foreach ($data as &$v) {
         $v['user_info'] = model('User')->getUserInfo($v['uid']);
         $v['content'] = parseForApi($v['content']);
         $v['ctime'] = date('Y-m-d H:i', $v['ctime']);
         $source && ($v['sourceInfo'] = model('Source')->getCommentSource($v, true));
         /* 解析出emoji */
         $v['content'] = formatEmoji(false, $v['content']);
     }
     is_null($data) && ($data = array());
     return $data;
 }
Beispiel #3
0
 /**
  * 修改用户信息 --using
  *
  * @param string $uname
  *                             用户名
  * @param int    $sex
  *                             性别(1-男,2-女)
  * @param string $intro
  *                             个人简介
  * @param string $city_id
  *                             地区ID
  * @param string $password
  *                             新密码
  * @param string $old_password
  *                             旧密码
  * @param string $tags
  *                             标签(多个标签之间用逗号隔开)
  */
 public function save_user_info()
 {
     $save = array();
     // 修改用户昵称
     if (isset($this->data['uname'])) {
         $uname = t($this->data['uname']);
         $save['uname'] = filter_keyword($uname);
         $oldName = t($this->data['old_name']);
         $res = model('Register')->isValidName($uname);
         if (!$res) {
             $error = model('Register')->getLastError();
             return array('status' => 0, 'msg' => $error);
         }
         // 如果包含中文将中文翻译成拼音
         if (preg_match('/[\\x7f-\\xff]+/', $save['uname'])) {
             // 昵称和呢称拼音保存到搜索字段
             $save['search_key'] = $save['uname'] . ' ' . model('PinYin')->Pinyin($save['uname']);
         } else {
             $save['search_key'] = $save['uname'];
         }
     }
     // 修改性别
     if (isset($this->data['sex'])) {
         $save['sex'] = 1 == intval($this->data['sex']) ? 1 : 2;
     }
     // 修改个人简介
     if (isset($this->data['intro'])) {
         $save['intro'] = formatEmoji(true, t($this->data['intro']));
     }
     // 修改地区
     if ($this->data['city_id']) {
         $area_id = intval($this->data['city_id']);
         $area = D('area')->where('area_id=' . $area_id)->find();
         $city = D('area')->where('area_id=' . $area['pid'])->find();
         $province = D('area')->where('area_id=' . $city['pid'])->find();
         $save['province'] = intval($province['area_id']);
         $save['city'] = intval($city['area_id']);
         $save['area'] = t($area['area_id']);
         $save['location'] = $province['title'] . ' ' . $city['title'] . ' ' . $area['title'];
     }
     // 修改密码
     if ($this->data['password']) {
         $regmodel = model('Register');
         // 验证格式
         if (!$regmodel->isValidPassword($this->data['password'], $this->data['password'])) {
             $msg = $regmodel->getLastError();
             $return = array('status' => 0, 'msg' => $msg);
             return $return;
         }
         // 验证新密码与旧密码是否一致
         if ($this->data['password'] == $this->data['old_password']) {
             $return = array('status' => 0, 'msg' => L('PUBLIC_PASSWORD_SAME'));
             return $return;
         }
         // 验证原密码是否正确
         $user = model('User')->where('`uid`=' . $this->mid)->find();
         if (md5(md5($this->data['old_password']) . $user['login_salt']) != $user['password']) {
             $return = array('status' => 0, 'msg' => L('PUBLIC_ORIGINAL_PASSWORD_ERROR'));
             // 原始密码错误
             return $return;
         }
         $login_salt = rand(11111, 99999);
         $save['login_salt'] = $login_salt;
         $save['password'] = md5(md5($this->data['password']) . $login_salt);
     }
     if (!empty($save)) {
         $res = model('User')->where('`uid`=' . $this->mid)->save($save);
         $res !== false && model('User')->cleanCache($this->mid);
         $user_feeds = model('Feed')->where('uid=' . $this->mid)->field('feed_id')->findAll();
         if ($user_feeds) {
             $feed_ids = getSubByKey($user_feeds, 'feed_id');
             model('Feed')->cleanCache($feed_ids, $this->mid);
         }
     }
     // 修改用户标签
     if (isset($this->data['tags'])) {
         if (empty($this->data['tags'])) {
             return array('status' => 0, 'msg' => L('PUBLIC_TAG_NOEMPTY'));
         }
         $nameList = t($this->data['tags']);
         $nameList = explode(',', $nameList);
         $tagIds = array();
         foreach ($nameList as $name) {
             $tagIds[] = model('Tag')->setAppName('public')->setAppTable('user')->getTagId($name);
         }
         $rowId = intval($this->mid);
         if (!empty($rowId)) {
             $registerConfig = model('Xdata')->get('admin_Config:register');
             if (count($tagIds) > $registerConfig['tag_num']) {
                 return array('status' => 0, 'msg' => '最多只能设置' . $registerConfig['tag_num'] . '个标签');
             }
             model('Tag')->setAppName('public')->setAppTable('user')->updateTagData($rowId, $tagIds);
         }
     }
     return array('status' => 1, 'msg' => '修改成功');
 }
Beispiel #4
0
 /**
  * 获取用户信息 --using
  *
  * @param  int   $uid
  *                    用户UID
  * @return array 用户信息
  */
 protected function get_user_info($uid)
 {
     $user_info = model('Cache')->get('user_info_api_' . $uid);
     if (!$user_info) {
         $user_info = model('User')->where('uid=' . $uid)->field('uid,uname,sex,location,province,city,area,intro')->find();
         // 头像
         $avatar = model('Avatar')->init($uid)->getUserAvatar();
         // $user_info ['avatar'] ['avatar_middle'] = $avatar ["avatar_big"];
         // $user_info ['avatar'] ['avatar_big'] = $avatar ["avatar_big"];
         $user_info['avatar'] = $avatar;
         // 用户组
         $user_group = model('UserGroupLink')->where('uid=' . $uid)->field('user_group_id')->findAll();
         foreach ($user_group as $v) {
             $user_group_icon = D('user_group')->where('user_group_id=' . $v['user_group_id'])->getField('user_group_icon');
             if ($user_group_icon != -1) {
                 $user_info['user_group'][] = THEME_PUBLIC_URL . '/image/usergroup/' . $user_group_icon;
             }
         }
         model('Cache')->set('user_info_api_' . $uid, $user_info);
     }
     // 积分、经验
     $user_info['user_credit'] = model('Credit')->getUserCredit($uid);
     $user_info['intro'] && ($user_info['intro'] = formatEmoji(false, $user_info['intro']));
     // 用户统计
     $user_info['user_data'] = model('UserData')->getUserData($uid);
     return $user_info;
 }
Beispiel #5
0
 /**
  * 获取资源信息 --using
  *
  * @param
  *        	varchar app 应用名称
  * @param
  *        	integer app_row_table 资源所在表
  * @param
  *        	integer app_row_id 资源ID
  * @return array 资源信息
  */
 private function get_source_info($app, $app_row_table, $app_row_id)
 {
     switch ($app) {
         case 'weiba':
             $weiba_post = D('weiba_post')->where('post_id=' . $app_row_id . ' AND is_del = 0')->field('weiba_id,post_uid,title,content')->find();
             if ($weiba_post) {
                 $source_info['user_info'] = $this->get_user_info($weiba_post['post_uid']);
                 $source_info['title'] = $weiba_post['title'];
                 $source_info['content'] = real_strip_tags($weiba_post['content']);
                 $source_info['url'] = 'mod=Weibo&act=weibo_detail&id=' . $app_row_id;
                 $source_info['source_name'] = D('weiba')->where('weiba_id=' . $weiba_post['weiba_id'])->getField('weiba_name');
                 $source_info['source_url'] = 'api.php?mod=Weiba&act=post_detail&id=' . $app_row_id;
                 /* emoji解析 */
                 $source_info['title'] = formatEmoji(false, $source_info['title']);
                 $source_info['content'] = formatEmoji(false, $source_info['content']);
             } else {
                 $source_info['is_del'] = 1;
             }
             break;
         default:
             $tablePrefix = C('DB_PREFIX');
             $map['a.feed_id'] = $app_row_id;
             $map['a.is_del'] = 0;
             $data = model('Feed')->where($map)->table("{$tablePrefix}feed AS a LEFT JOIN {$tablePrefix}feed_data AS b ON a.feed_id = b.feed_id ")->find();
             if ($data['feed_id']) {
                 $source_info['publish_time'] = $data['publish_time'];
                 $source_info['feed_id'] = $app_row_id;
                 $source_info['user_info'] = $this->get_user_info($data['uid']);
                 $source_info['type'] = real_strip_tags($data['type']);
                 $source_info['content'] = real_strip_tags($data['feed_content']);
                 $source_info['content'] = parseForApi($source_info['content']);
                 $source_info['url'] = 'mod=Weibo&act=weibo_detail&id=' . $app_row_id;
                 // 附件处理
                 $feed_data = unserialize($data['feed_data']);
                 if (!empty($feed_data['attach_id'])) {
                     $attach = model('Attach')->getAttachByIds($feed_data['attach_id']);
                     foreach ($attach as $ak => $av) {
                         $_attach = array('attach_id' => $av['attach_id'], 'attach_name' => $av['name']);
                         if ($data['type'] == 'postimage') {
                             $_attach['attach_origin'] = getImageUrl($av['save_path'] . $av['save_name']);
                             $_attach['attach_origin_width'] = $av['width'];
                             $_attach['attach_origin_height'] = $av['height'];
                             if ($av['width'] > 550 && $av['height'] > 550) {
                                 $_attach['attach_small'] = getImageUrl($av['save_path'] . $av['save_name'], 550, 550, true);
                             } else {
                                 $_attach['attach_small'] = $_attach['attach_origin'];
                             }
                         }
                         $source_info['attach_info'][] = $_attach;
                     }
                 } else {
                     $source_info['attach_info'] = array();
                 }
                 if ($data['type'] == 'postvideo') {
                     if ($feed_data['video_id']) {
                         $video_config = model('Xdata')->get('admin_Content:video_config');
                         $video_server = $video_config['video_server'] ? $video_config['video_server'] : SITE_URL;
                         $video_info['video_id'] = $feed_data['video_id'];
                         $video_info['flashimg'] = $video_server . $feed_data['image_path'];
                         $video_info['flash_width'] = $feed_data['image_width'];
                         $video_info['flash_height'] = $feed_data['image_height'];
                         if ($feed_data['transfer_id'] && !D('video_transfer')->where('transfer_id=' . $feed_data['transfer_id'])->getField('status')) {
                             $video_info['transfering'] = 1;
                         } else {
                             $video_info['flashvar'] = $feed_data['video_mobile_path'] ? $video_server . $feed_data['video_mobile_path'] : $video_server . $feed_data['video_path'];
                             $video_info['flashvar_part'] = $video_server . $feed_data['video_part_path'];
                         }
                     } else {
                         $video_info['host'] = $feed_data['host'];
                         $video_info['flashvar'] = $feed_data['source'];
                         $video_info['source'] = $feed_data['source'];
                         $video_info['flashimg'] = UPLOAD_URL . $feed_data['flashimg'];
                         $video_info['title'] = $feed_data['title'];
                     }
                     $source_info['attach_info'][] = $video_info;
                 }
             } else {
                 $source_info['is_del'] = 1;
             }
             break;
     }
     return $source_info;
 }
 /**
  * 帖子列表
  */
 private function _post_list($post_type, $limit)
 {
     $db_prefix = C('DB_PREFIX');
     switch ($post_type) {
         case 'reply':
             $sql = "SELECT a.* FROM `{$db_prefix}weiba_post` a, `{$db_prefix}weiba` b WHERE a.weiba_id=b.weiba_id AND ( b.`is_del` = 0 ) AND ( b.`status` = 1 ) AND ( a.`is_del` = 0 ) ORDER BY a.last_reply_time desc LIMIT " . $limit;
             break;
         case 'hot':
             $sql = "SELECT a.* FROM `{$db_prefix}weiba_post` a, `{$db_prefix}weiba` b WHERE a.weiba_id=b.weiba_id AND ( b.`is_del` = 0 ) AND ( b.`status` = 1 )  AND ( a.`is_del` = 0 ) ORDER BY a.reply_all_count desc LIMIT " . $limit;
             break;
         case 'digest':
             $sql = "SELECT a.* FROM `{$db_prefix}weiba_post` a, `{$db_prefix}weiba` b WHERE a.weiba_id=b.weiba_id AND ( b.`is_del` = 0 ) AND ( b.`status` = 1 )  AND ( a.`digest` = 1 ) AND ( a.`is_del` = 0 ) ORDER BY a.post_time desc LIMIT " . $limit;
             break;
         case 'recommend':
             $sql = "SELECT a.* FROM `{$db_prefix}weiba_post` a, `{$db_prefix}weiba` b WHERE a.weiba_id=b.weiba_id AND ( b.`is_del` = 0 ) AND ( b.`status` = 1 )  AND ( a.`recommend` = 1 ) AND ( a.`is_del` = 0 ) ORDER BY a.recommend_time desc LIMIT " . $limit;
             break;
         case 'top':
             $sql = "SELECT a.* FROM `{$db_prefix}weiba_post` a, `{$db_prefix}weiba` b WHERE a.weiba_id=b.weiba_id AND ( b.`is_del` = 0 ) AND ( b.`status` = 1 )  AND ( a.`top` = 2 ) AND ( a.`is_del` = 0 ) ORDER BY a.last_reply_time desc LIMIT " . $limit;
             break;
         case 'nrecommend':
             $sql = "SELECT a.* FROM `{$db_prefix}weiba_post` a, `{$db_prefix}weiba` b WHERE a.weiba_id=b.weiba_id AND ( b.`is_del` = 0 ) AND ( b.`status` = 1 )  AND ( a.`top` = 2 ) AND ( a.`is_del` = 0 ) ORDER BY a.top_time desc LIMIT " . $limit;
             break;
         case 'topandrecomment':
             $sql = "SELECT a.* FROM `{$db_prefix}weiba_post` a, `{$db_prefix}weiba` b WHERE a.weiba_id=b.weiba_id AND ( b.`is_del` = 0 ) AND ( b.`status` = 1 )  AND ( a.`recommend` = 1 ) AND ( a.`is_del` = 0 ) ORDER BY a.top desc,a.last_reply_time desc";
             break;
         default:
             //new
             $sql = "SELECT a.* FROM `{$db_prefix}weiba_post` a, `{$db_prefix}weiba` b WHERE a.weiba_id=b.weiba_id AND ( b.`is_del` = 0 ) AND ( b.`status` = 1 )  AND ( a.`is_del` = 0 ) ORDER BY a.post_time desc LIMIT " . $limit;
             break;
     }
     $post_list = D('weiba_post')->query($sql);
     $weiba_ids = getSubByKey($post_list, 'weiba_id');
     $nameArr = $this->_getWeibaName($weiba_ids);
     foreach ($post_list as $k => $v) {
         $post_list[$k]['weiba'] = $nameArr[$v['weiba_id']];
         $post_list[$k]['user'] = model('User')->getUserInfo($v['post_uid']);
         $post_list[$k]['replyuser'] = model('User')->getUserInfo($v['last_reply_uid']);
         // $images = matchImages($v['content']);
         // $images[0] && $post_list[$k]['image'] = array_slice( $images , 0 , 5 );
         $image = getEditorImages($v['content']);
         !empty($image) && ($post_list[$k]['image'] = array($image));
         //匹配图片的src
         preg_match_all('#<img.*?src="([^"]*)"[^>]*>#i', $v['content'], $match);
         foreach ($match[1] as $imgurl) {
             $imgurl = $imgurl;
             if (!empty($imgurl)) {
                 $post_list[$k]['img'][] = $imgurl;
             }
         }
         /* 解析emoji */
         $post_list[$k]['title'] = formatEmoji(false, $v['title']);
         $post_list[$k]['content'] = formatEmoji(false, $v['content']);
     }
     return $post_list;
 }
Beispiel #7
0
 public function add_post($imgs)
 {
     if (!CheckPermission('weiba_normal', 'weiba_post')) {
         $this->error('对不起,您没有权限进行该操作!');
     }
     $weibaid = intval($this->data['weiba_id']);
     if (!$weibaid) {
         $this->error('请选择微吧!');
     }
     $weiba = D('weiba')->where('weiba_id=' . $weibaid)->find();
     if (!CheckPermission('core_admin', 'admin_login')) {
         switch ($weiba['who_can_post']) {
             case 1:
                 $map['weiba_id'] = $weibaid;
                 $map['follower_uid'] = $this->mid;
                 $res = D('weiba_follow')->where($map)->find();
                 if (!$res && !CheckPermission('core_admin', 'admin_login')) {
                     $this->error('对不起,您没有发帖权限,请关注该微吧!');
                 }
                 break;
             case 2:
                 $map['weiba_id'] = $weibaid;
                 $map['level'] = array('in', '2,3');
                 $weiba_admin = D('weiba_follow')->where($map)->order('level desc')->field('follower_uid')->findAll();
                 if (!in_array($this->mid, getSubByKey($weiba_admin, 'follower_uid')) && !CheckPermission('core_admin', 'admin_login')) {
                     $this->error('对不起,您没有发帖权限,仅限管理员发帖!');
                 }
                 break;
             case 3:
                 $map['weiba_id'] = $weibaid;
                 $map['level'] = 3;
                 $weiba_admin = D('weiba_follow')->where($map)->order('level desc')->field('follower_uid')->find();
                 if ($this->mid != $weiba_admin['follower_uid'] && !CheckPermission('core_admin', 'admin_login')) {
                     $this->error('对不起,您没有发帖权限,仅限吧主发帖!');
                 }
                 break;
         }
     }
     if (!empty($imgs)) {
         foreach ($imgs as $v) {
             $src = getImageUrlByAttachId($v['attach_id'], 320, 1000);
             $src && ($img_arr[] = '<img src="' . $src . '" class="mobile_upload" _src="' . getImageUrlByAttachId($v['attach_id']) . '" />');
         }
         $this->data['content'] = implode(' ', $img_arr) . $this->data['content'];
     }
     $checkContent = str_replace('&nbsp;', '', $this->data['content']);
     $checkContent = str_replace('<br />', '', $checkContent);
     $checkContent = str_replace('<p>', '', $checkContent);
     $checkContent = str_replace('</p>', '', $checkContent);
     $checkContents = preg_replace('/<img(.*?)src=/i', 'img', $checkContent);
     $checkContents = preg_replace('/<embed(.*?)src=/i', 'img', $checkContents);
     if (strlen(t($this->data['title'])) == 0) {
         $this->error('帖子标题不能为空');
     }
     if (strlen(t($checkContents)) == 0) {
         $this->error('帖子内容不能为空');
     }
     preg_match_all('/./us', t($this->data['title']), $match);
     if (count($match[0]) > 20) {
         // 汉字和字母都为一个字
         $this->error('帖子标题不能超过20个字');
     }
     if ($this->data['attach_ids']) {
         $attach = explode('|', $this->data['attach_ids']);
         foreach ($attach as $k => $a) {
             if (!$a) {
                 unset($attach[$k]);
             }
         }
         $attach = array_map('intval', $attach);
         $data['attach'] = serialize($attach);
     }
     $data['weiba_id'] = $weibaid;
     $data['title'] = t($this->data['title']);
     $data['content'] = h($this->data['content']);
     // 格式化emoji
     $data['title'] = formatEmoji(true, $data['title']);
     $data['content'] = formatEmoji(true, $data['content']);
     // 处理换行,临时解决方案
     $br = array("\r\n", "\n", "\r");
     $replace = '<br/>';
     $data['content'] = str_replace($br, $replace, $data['content']);
     $data['post_uid'] = $this->mid;
     $data['post_time'] = time();
     $data['last_reply_uid'] = $this->mid;
     $data['last_reply_time'] = $data['post_time'];
     $filterTitleStatus = filter_words($data['title']);
     if (!$filterTitleStatus['status']) {
         $this->error($filterTitleStatus['data'], true);
     }
     $data['title'] = $filterTitleStatus['data'];
     $filterContentStatus = filter_words($data['content']);
     if (!$filterContentStatus['status']) {
         $this->error($filterContentStatus['data'], true);
     }
     $data['content'] = $filterContentStatus['data'];
     $res = D('weiba_post')->add($data);
     if ($res) {
         D('weiba')->where('weiba_id=' . $data['weiba_id'])->setInc('thread_count');
         // 同步到微博
         // $feed_id = D('weibaPost')->syncToFeed($res,$data['title'],t($checkContent),$this->mid);
         $feed_id = model('Feed')->syncToFeed('weiba', $this->mid, $res);
         D('weiba_post')->where('post_id=' . $res)->setField('feed_id', $feed_id);
         // $this->assign('jumpUrl', U('weiba/Index/postDetail',array('post_id'=>$res)));
         // $this->success('发布成功');
         $result['id'] = $res;
         $result['feed_id'] = $feed_id;
         // 添加积分
         model('Credit')->setUserCredit($this->mid, 'publish_topic');
         return array('status' => 1, 'post_id' => $res, 'msg' => '发布成功');
     } else {
         $this->error('发布失败');
     }
 }
Beispiel #8
0
 /**
  * 记录或获取第三方登录接口获取到的信息 --using
  * @param varchar type 帐号类型
  * @param varchar type_uid 第三方用户标识
  * @param varchar access_token 第三方access token
  * @param varchar refresh_token 第三方refresh token(选填,根据第三方返回值)
  * @param varchar expire_in 过期时间(选填,根据第三方返回值)
  * @return array 状态+提示信息/数据
  */
 public function get_other_login_info()
 {
     $type = addslashes($this->data['type']);
     $type_uid = addslashes($this->data['type_uid']);
     $access_token = addslashes($this->data['access_token']);
     $refresh_token = addslashes($this->data['refresh_token']);
     $expire = intval($this->data['expire_in']);
     if (!empty($type) && !empty($type_uid)) {
         $user = M('login')->where("type_uid='{$type_uid}' AND type='{$type}'")->find();
         if ($user && $user['uid'] > 0) {
             if ($login = M('login')->where('uid=' . $user['uid'] . " AND type='location'")->find()) {
                 $data['oauth_token'] = $login['oauth_token'];
                 $data['oauth_token_secret'] = $login['oauth_token_secret'];
                 $data['uid'] = $login['uid'];
                 $arr_un_in = M('user')->where(array('uid' => $user['uid']))->field('uname,intro')->find();
                 $data['uname'] = $arr_un_in['uname'];
                 $data['intro'] = $arr_un_in['intro'] ? formatEmoji(true, $arr_un_in['intro']) : '';
                 $data['avatar'] = getUserFace($user['uid'], 'm');
             } else {
                 $data['oauth_token'] = getOAuthToken($user['uid']);
                 $data['oauth_token_secret'] = getOAuthTokenSecret();
                 $data['uid'] = $user['uid'];
                 $savedata['type'] = 'location';
                 $savedata = array_merge($savedata, $data);
                 $result = M('login')->add($savedata);
                 if (!$result) {
                     return array('status' => 0, 'msg' => '获取失败');
                 }
             }
             //生成ticket
             if ($live_user_info = D('live_user_info')->where(array('uid' => $user['uid']))->find()) {
                 $data['ticket'] = $live_user_info['ticket'];
             } else {
                 $live_user_info = file_get_contents(SITE_URL . '/api.php?api_version=live&mod=LiveUser&act=postUser&uid=' . $user['uid']);
                 $live_user_info = json_decode($live_user_info, true);
                 $live_user_info['status'] == 1 && ($data['ticket'] = $live_user_info['data']['ticket']);
             }
             $data['ticket'] = $live_user_info['ticket'];
             return $data;
         } else {
             return array('status' => 0, 'msg' => '帐号尚未绑定');
         }
     } else {
         return array('status' => 0, 'msg' => '参数错误');
     }
 }
 /**
  * 获取指定用户的相关信息
  *
  * @param  array $map
  *                    查询条件
  * @return array 指定用户的相关信息
  */
 private function _getUserInfo(array $map, $field = '*')
 {
     $user = $this->getUserDataByCache($map, $field);
     unset($user['password']);
     if (!$user) {
         $this->error = L('PUBLIC_GET_INFORMATION_FAIL');
         // 获取用户信息失败
         return false;
     } else {
         $uid = $user['uid'];
         $user = array_merge($user, model('Avatar')->init($user['uid'])->getUserAvatar());
         $user['avatar_url'] = U('public/Attach/avatar', array('uid' => $user['uid']));
         $user['space_url'] = !empty($user['domain']) ? U('public/Profile/index', array('uid' => $user['domain'])) : U('public/Profile/index', array('uid' => $user['uid']));
         $user['space_link'] = "<a href='" . $user['space_url'] . "' target='_blank' uid='{$user['uid']}' event-node='face_card'>" . $user['uname'] . '</a>';
         $user['space_link_no'] = "<a href='" . $user['space_url'] . "' title='" . $user['uname'] . "' target='_blank'>" . $user['uname'] . '</a>';
         // 用户勋章
         $user['medals'] = model('Medal')->getMedalByUid($user['uid']);
         // 用户认证图标
         $groupIcon = $authIcon = array();
         $aIcon[5] = '<i class="type-trade"></i>';
         $aIcon[6] = '<i class="type-hangjia"></i>';
         $aIcon[7] = '<i class="type-daren"></i>';
         $userGroup = model('UserGroupLink')->getUserGroupData($uid);
         $user['api_user_group'] = $userGroup[$uid];
         $user['user_group'] = $userGroup[$uid];
         $only = array(array(), array());
         // 			$authenticate = array();
         foreach ($userGroup[$uid] as $value) {
             ($value['user_group_id'] == 5 || $value['user_group_id'] == 6) && ($value['company'] = M('user_verified')->where("uid={$uid} and usergroup_id=" . $value['user_group_id'])->getField('company'));
             if ($value['is_authenticate'] == 1) {
                 $authIcon[] = $aIcon[$value['user_group_id']];
                 $authenticate[$value['user_group_id']] = $value;
             }
             $groupIcon[] = '<img title="' . $value['user_group_name'] . '" src="' . $value['user_group_icon_url'] . '" style="width:auto;height:auto;display:inline;cursor:pointer;" />';
             $type = $value['is_authenticate'] ? 1 : 0;
             if (empty($only[$type])) {
                 $only[$type] = $value;
             } elseif ($only[$type]['ctime'] < $value['ctime']) {
                 $only[$type] = $value;
             }
         }
         if (!empty($only[0])) {
             $user['group_icon_only'] = $only[0];
         } elseif (!empty($only[1])) {
             $user['group_icon_only'] = $only[1];
         } else {
             $user['group_icon_only'] = array();
         }
         /*group_icon_only end*/
         $user['group_icon'] = implode('&nbsp;', $groupIcon);
         //$user ['auth_icon'] = implode ( ' ', $authIcon );
         $user['credit_info'] = model('Credit')->getUserCredit($uid);
         $user['intro'] = $user['intro'] ? formatEmoji(false, $user['intro']) : '';
         $user['uname'] = EmojiFormat::de($user['uname']);
         model('Cache')->set('ui_' . $uid, $user, 600);
         static_cache('user_info_' . $uid, $user);
         return $user;
     }
 }
Beispiel #10
0
/**
 * 格式化分享,替换话题
 * @param  string $content 待格式化的内容
 * @param  bool   $url     是否替换URL
 * @return string
 */
function format($content, $url = false)
{
    $content = stripslashes($content);
    $content = formatEmoji(false, $content);
    return $content;
}
Beispiel #11
0
 /**
  * 发现
  *
  * @return array
  * @author hhh <*****@*****.**>
  **/
 public function discover()
 {
     $open_arr = !empty($this->data['needs']) ? explode(',', t($this->data['needs'])) : array('1', '2', '3', '4', '5', '6', '7', '8', '9', '10');
     $type = !empty($this->data['type']) ? t($this->data['type']) : 'system';
     $list = S('api_discover_' . $type);
     if (!$list) {
         $list = array();
         // 轮播图
         if (in_array('1', $open_arr)) {
             $banners = $this->getSlideShow();
             $list['banner'] = $banners ? $banners : array();
         }
         // 微吧
         if (in_array('2', $open_arr)) {
             $wmap['recommend'] = 1;
             $wmap['status'] = 1;
             $wmap['is_del'] = 0;
             $weiba_recommend = D('Weiba')->where($wmap)->limit(8)->findAll();
             $weiba_id = getSubByKey($weiba_recommend, 'weiba_id');
             $followStatus = api('Weiba')->getFollowStateByWeibaids($this->mid, $weiba_id);
             foreach ($weiba_recommend as $k => $v) {
                 $weiba_recommend[$k]['logo'] = getImageUrlByAttachId($v['logo'], 200, 200);
                 $weiba_recommend[$k]['following'] = $followStatus[$v['weiba_id']]['following'];
                 if ($v['new_day'] != date('Y-m-d', time())) {
                     $weiba_recommend[$k]['new_count'] = 0;
                     $this->setNewcount($v['weiba_id'], 0);
                 }
                 $weiba_recommend[$k]['title'] = formatEmoji(false, $weiba_recommend[$k]['title']);
                 $weiba_recommend[$k]['content'] = formatEmoji(false, $weiba_recommend[$k]['content']);
             }
             $list['weibas'] = $weiba_recommend ? $weiba_recommend : array();
         }
         // 话题
         if (in_array('3', $open_arr)) {
             $tmap['recommend'] = 1;
             $tmap['lock'] = 0;
             $topic_recommend = D('FeedTopic')->where($tmap)->order('count desc')->limit(8)->field('topic_id,topic_name,pic')->findAll();
             foreach ($topic_recommend as $key => $value) {
                 if ($value['pic'] != null) {
                     $topic_recommend[$key]['pic'] = getImageUrlByAttachId($value['pic'], 100, 100);
                 } else {
                     $topic_recommend[$key]['pic'] = '';
                 }
             }
             $list['topics'] = $topic_recommend ? $topic_recommend : array();
         }
         //频道
         if (in_array('4', $open_arr)) {
             $cmap['pid'] = 0;
             $channel_recommend = D('ChannelCategory')->where($cmap)->order('sort asc')->limit(8)->field('channel_category_id,title,ext')->findAll();
             foreach ($channel_recommend as $key => $value) {
                 $serialize = unserialize($value['ext']);
                 if ($serialize['attach'] != '') {
                     $channel_recommend[$key]['pic'] = getImageUrlByAttachId($serialize['attach'], 100, 100);
                 } else {
                     $channel_recommend[$key]['pic'] = '';
                 }
                 unset($channel_recommend[$key]['ext']);
             }
             $list['channels'] = $channel_recommend ? $channel_recommend : array();
         }
         //资讯
         if (in_array('5', $open_arr)) {
             $tconf = model('Xdata')->get('Information_Admin:config');
             $hotTime = intval($tconf['hotTime']);
             if ($hotTime > 0) {
                 $hotTime = 60 * 60 * 24 * $hotTime;
                 $hotTime = time() - $hotTime;
                 $imap['ctime'] = array('gt', intval($hotTime));
             }
             $imap['isPre'] = 0;
             $imap['isDel'] = 0;
             $information_recommend = D('InformationList')->where($imap)->order('hits desc')->limit(8)->field('id,subject,content')->findAll();
             foreach ($information_recommend as $key => $value) {
                 preg_match_all('/\\<img(.*?)src\\=\\"(.*?)\\"(.*?)\\/?\\>/is', $value['content'], $image);
                 $image = $image[2];
                 if ($image && is_array($image) && count($image) >= 1) {
                     $image = $image[array_rand($image)];
                     if (!preg_match('/https?\\:\\/\\//is', $image)) {
                         $image = parse_url(SITE_URL, PHP_URL_SCHEME) . '://' . parse_url(SITE_URL, PHP_URL_HOST) . '/' . $image;
                     }
                 }
                 $information_recommend[$key]['pic'] = !empty($image) ? $image : '';
                 $information_recommend[$key]['url'] = sprintf('%s/api.php?mod=Information&act=reader&id=%d', SITE_URL, intval($value['id']));
                 unset($information_recommend[$key]['content']);
             }
             $list['information'] = $information_recommend ? $information_recommend : array();
         }
         //找人
         if (in_array('6', $open_arr)) {
             $user = model('RelatedUser')->getRelatedUser(8);
             $user_list = array();
             foreach ($user as $k => $v) {
                 $user_list[$k]['uid'] = $v['userInfo']['uid'];
                 $user_list[$k]['uname'] = $v['userInfo']['uname'];
                 $user_list[$k]['remark'] = $v['userInfo']['remark'];
                 $user_list[$k]['avatar'] = $v['userInfo']['avatar_big'];
                 $privacy = model('UserPrivacy')->getPrivacy($this->mid, $v['userInfo']['uid']);
                 $user_list[$k]['space_privacy'] = $privacy['space'];
             }
             $list['users'] = $user_list;
         }
         //附近的人
         if (in_array('7', $open_arr)) {
             $users = api('FindPeople')->around();
             foreach ($users['data'] as $key => $value) {
                 $findp['uid'] = $value['uid'];
                 $findp['uname'] = $value['username'];
                 $findp['remark'] = $value['remark'];
                 $findp['avatar'] = $value['avatar'];
                 $privacy = model('UserPrivacy')->getPrivacy($this->mid, $value['uid']);
                 $findp['space_privacy'] = $privacy['space'];
                 $fpeople[] = $findp;
             }
             $list['near_users'] = $fpeople ? $fpeople : array();
         }
         //积分商城
         if (in_array('8', $open_arr)) {
             $giftlogs = D('GiftLog')->field('`gid`')->group('`gid`')->order('COUNT(`gid`) DESC')->limit(8)->findAll();
             foreach ($giftlogs as $key => $value) {
                 $gift = D('Gift')->where(array('id' => $value['gid']))->field('id,name,image')->find();
                 $gift['image'] = getImageUrlByAttachId($gift['image']);
                 $gifts[] = $gift;
             }
             $list['gifts'] = $gifts ? $gifts : array();
         }
         S('api_discover_' . $type, $list, 3600);
     }
     //直播
     if (in_array('9', $open_arr)) {
         $lives_url = 'http://zbtest.zhibocloud.cn/stream/getList';
         $lives_rs = file_get_contents($lives_url);
         $lives_rs = json_decode($lives_rs, true);
         if ($lives_rs['data']) {
             foreach ($lives_rs['data'] as $key => $value) {
                 if ($key > 8) {
                     break;
                 }
                 //用户信息
                 $uid = D('live_user_info')->where(array('usid' => $value['user']['usid']))->getField('uid');
                 $userInfo = api('User')->get_user_info($uid);
                 $user_info['uid'] = (string) $userInfo['uid'];
                 $user_info['uname'] = $userInfo['uname'];
                 $user_info['sex'] = $userInfo['sex'];
                 $user_info['intro'] = $userInfo['intro'] ? formatEmoji(false, $userInfo['intro']) : '';
                 $user_info['location'] = $userInfo['location'] ? $userInfo['location'] : '';
                 $user_info['avatar'] = (object) array($userInfo['avatar']['avatar_big']);
                 $user_info['gold'] = intval($userInfo['user_credit']['credit']['score']['value']);
                 $user_info['fans_count'] = intval($userInfo['user_data']['follower_count']);
                 $user_info['is_verified'] = 0;
                 $user_info['usid'] = $value['user']['usid'];
                 $credit_mod = M('credit_user');
                 $credit = $credit_mod->where(array('uid' => $uid))->find();
                 $user_info['zan_count'] = $credit['zan_remain'];
                 $user_info['live_time'] = $credit['live_time'];
                 $res = model('Follow')->getFollowStateByFids($this->mid, intval($uid));
                 $user_info['is_follow'] = $res[$uid]['following'];
                 /* # 获取用户封面 */
                 $cover = D('user_data')->where('`key` LIKE "application_user_cover" AND `uid` = ' . $v)->field('value')->getField('value');
                 $user_info['cover'] = $cover ? (object) array($cover) : (object) [];
                 $value['user'] = $user_info;
                 $icon = $value['stream']['icon'];
                 $value['stream']['icon'] = $icon ? (object) $icon : (object) [];
                 $lives[] = $value;
             }
             $list['lives'] = $lives;
         } else {
             $list['lives'] = array();
         }
     }
     //极铺商品
     if (in_array('10', $open_arr)) {
         $jipu_url = 'http://www.jipushop.com/Api/tsGoods';
         $goods_rs = file_get_contents($jipu_url);
         $goods_rs = json_decode($goods_rs, true);
         $list['jipu_goods'] = $goods_rs;
     }
     return $list;
 }
Beispiel #12
0
 /**
  * 分享到分享
  *
  * @example 需要传入的$data值
  *          sid:转发的分享/资源ID
  *          app_name:app名称
  *          content:转发时的内容信息,有时候会有某些标题的资源
  *          body:转发时,自定义写入的内容
  *          type:分享类型(分享原文app_row_table)
  *          comment:是否给原作者评论
  * @param  array  $data
  *                          分享的相关数据
  * @param  string $from
  *                          是否发@给资源作者,默认为share
  * @param  array  $lessUids
  *                          去掉@用户,默认为null
  * @return array  分享操作后,相关反馈信息数据
  */
 public function shareFeed($data, $from = 'share', $lessUids = null)
 {
     // 返回的数据结果集
     $return = array('status' => 0, 'data' => L('PUBLIC_SHARE_FAILED'));
     // 分享失败
     // 验证数据正确性
     if (empty($data['sid'])) {
         return $return;
     }
     $stable = t($data['type']);
     // 资源所在的表名
     $sid = t($data['sid']);
     $app = isset($data['app_name']) ? $data['app_name'] : APP_NAME;
     // 当前产生分享所属的应用
     $forApi = $data['forApi'] ? true : false;
     // 是否为接口形式
     if (!($oldInfo = model('Source')->getSourceInfo($stable, $sid, $forApi, $app))) {
         $return['data'] = L('PUBLIC_INFO_SHARE_FORBIDDEN');
         // 此信息不可以被分享
         return $return;
     }
     // 内容数据
     $d['content'] = isset($data['content']) ? str_replace(SITE_URL, '[SITE_URL]', $data['content']) : '';
     $d['body'] = str_replace(SITE_URL, '[SITE_URL]', $data['body']);
     // 处理分享类型
     $feedType = 'repost';
     // 默认为普通的转发格式
     if (!empty($oldInfo['feedtype']) && !in_array($oldInfo['feedtype'], array('post', 'postimage', 'postfile'))) {
         $feedType = $oldInfo['feedtype'];
     }
     if ($app != 'public') {
         // 非分享类型内容转发
         $oldInfo['uid'] = $oldInfo['source_user_info']['uid'];
         $oldInfo['sourceInfo']['source_id'] = $oldInfo['feed_id'];
         $feedType = $app . '_repost';
     }
     $d['sourceInfo'] = !empty($oldInfo['sourceInfo']) ? $oldInfo['sourceInfo'] : $oldInfo;
     /* emoji处理 */
     isset($d['sourceInfo']['source_content']) && ($d['sourceInfo']['source_content'] = formatEmoji(true, $d['sourceInfo']['source_content']));
     // 是否发送@上级节点
     $isOther = $from == 'comment' ? false : true;
     // 获取上个节点资源ID
     $d['curid'] = $data['curid'];
     // 获取转发原分享信息
     $appId = $oldInfo['source_id'];
     $appTable = $oldInfo['source_table'];
     $d['from'] = isset($data['from']) ? intval($data['from']) : 0;
     $d['latitude'] = isset($data['latitude']) ? $data['latitude'] : 0;
     $d['longitude'] = isset($data['longitude']) ? $data['longitude'] : 0;
     $d['address'] = isset($data['address']) ? $data['address'] : 0;
     if ($res = model('Feed')->put($GLOBALS['ts']['mid'], $app, $feedType, $d, $appId, $appTable, null, $lessUids, $isOther, 1)) {
         // if($data['comment'] != 0 && $oldInfo['uid'] != $data['comment_touid']) {
         if ($data['comment'] != 0 || $data['comment_old'] != 0) {
             // && $oldInfo['uid'] != $data['comment_touid']
             // 发表评论
             $c['type'] = 2;
             $c['app'] = $app;
             $c['table'] = 'feed';
             $c['app_uid'] = $oldInfo['uid'];
             $c['content'] = !empty($d['body']) ? $d['body'] : $d['content'];
             $c['row_id'] = !empty($oldInfo['sourceInfo']) ? $oldInfo['sourceInfo']['source_id'] : $appId;
             $c['client_type'] = getVisitorClient();
             $notCount = true;
             unlockSubmit();
             $comment_id = model('Comment')->addComment($c, true, $notCount, $lessUids);
             // 同步到微吧
             if ($app == 'weiba') {
                 $postDetail = D('weiba_post')->where('feed_id=' . $c['row_id'])->find();
                 if ($postDetail) {
                     $datas['weiba_id'] = $postDetail['weiba_id'];
                     $datas['post_id'] = $postDetail['post_id'];
                     $datas['post_uid'] = $postDetail['post_uid'];
                     // $datas['to_reply_id'] = $data['to_comment_id']?D('weiba_reply')->where('comment_id='.$data['to_comment_id'])->getField('reply_id'):0;
                     // $datas['to_uid'] = $data['to_uid'];
                     $datas['uid'] = $GLOBALS['ts']['mid'];
                     $datas['ctime'] = time();
                     $datas['content'] = $c['content'];
                     $datas['comment_id'] = $comment_id;
                     if (D('weiba_reply')->add($datas)) {
                         $map['last_reply_uid'] = $this->mid;
                         $map['last_reply_time'] = $datas['ctime'];
                         D('weiba_post')->where('post_id=' . $datas['post_id'])->save($map);
                         // 回复统计数加1
                         D('weiba_post')->where('post_id=' . $datas['post_id'])->setInc('reply_count');
                     }
                 }
             }
         }
         // 添加话题
         model('FeedTopic')->addTopic(html_entity_decode($d['body'], ENT_QUOTES), $res['feed_id'], $feedType);
         // 渲染数据
         $rdata = $res;
         // 渲染完后的结果
         $rdata['feed_id'] = $res['feed_id'];
         $rdata['app_row_id'] = $data['sid'];
         $rdata['app_row_table'] = $data['type'];
         $rdata['app'] = $app;
         $rdata['is_repost'] = 1;
         switch ($app) {
             case 'weiba':
                 $rdata['from'] = getFromClient(0, $app, '微吧');
                 break;
             default:
                 $rdata['from'] = getFromClient($from, $app);
                 break;
         }
         $return['data'] = $rdata;
         $return['status'] = 1;
         // 被分享内容“分享统计”数+1,同时可检测出app,table,row_id 的有效性
         if (!($pk = D($data['type'], $data['app_name'])->getPk())) {
             $pk = $data['type'] . '_id';
         }
         D($data['type'], $data['app_name'])->setInc('repost_count', "`{$pk}`={$data['sid']}", 1);
         if ($data['curid'] != $data['sid'] && !empty($data['curid'])) {
             if (!($pk = D($data['curtable'])->getPk())) {
                 $pk = $data['curtable'] . '_id';
             }
             D($data['curtable'])->setInc('repost_count', "`{$pk}`={$data['curid']}", 1);
             D($data['curtable'])->cleanCache($data['curid']);
         }
         D($data['type'], $data['app_name'])->cleanCache($data['sid']);
     } else {
         $return['data'] = model('Feed')->getError();
     }
     return $return;
 }
Beispiel #13
0
 /**
  * 根据通讯录搜索用户 --using
  *
  * @param
  *        	string tel 以逗号连接的手机号码串
  * @return array
  */
 public function search_by_tel()
 {
     $tel_array = array_unique(array_filter(explode(',', $this->data['tel'])));
     $data = array();
     $user_list = array();
     $user_list1 = array();
     if ($tel_array) {
         foreach ($tel_array as $k => $v) {
             if (preg_match("/^[1][3578]\\d{9}\$/", t($v)) !== 0) {
                 if ($uid = model('User')->where(array('phone' => t($v)))->getField('uid')) {
                     $user_info = api('User')->get_user_info($uid);
                     $user_list[$k]['tel'] = $v;
                     $user_list[$k]['uid'] = $user_info['uid'];
                     $user_list[$k]['uname'] = $user_info['uname'];
                     $user_list[$k]['remark'] = $user_info['remark'];
                     $user_list[$k]['avatar'] = $user_info['avatar']['avatar_big'];
                     $user_list[$k]['intro'] = $user_info['intro'] ? formatEmoji(false, $user_info['intro']) : '';
                     $user_list[$k]['follow_status'] = model('Follow')->getFollowState($this->mid, $user_info['uid']);
                 } else {
                     $user_list1[$k]['uid'] = 0;
                     $user_list1[$k]['tel'] = $v;
                 }
             }
         }
         $data = array_merge($user_list, $user_list1);
     }
     return $data;
 }
Beispiel #14
0
 /**
  * 保存基本信息操作
  *
  * @return json 返回操作后的JSON信息数据
  */
 public function doSaveProfile()
 {
     $res = true;
     // 保存用户表信息
     if (!empty($_POST['sex'])) {
         $save['sex'] = 1 == intval($_POST['sex']) ? 1 : 2;
         // $save['lang'] = t($_POST['lang']);
         $save['intro'] = $_POST['intro'] ? formatEmoji(true, t($_POST['intro'])) : '';
         /* # 检查用户简介是否超出字数限制 */
         if (get_str_length($save['intro']) > 150) {
             $this->ajaxReturn(null, '个人简介不得超过150字', 0);
         }
         // 添加地区信息
         $save['location'] = t($_POST['city_names']);
         $cityIds = t($_POST['city_ids']);
         $cityIds = explode(',', $cityIds);
         /* if (! $cityIds [0] || ! $cityIds [1] || ! $cityIds [2])
            $this->error ( '请选择完整地区' ); */
         isset($cityIds[0]) && ($save['province'] = intval($cityIds[0]));
         if ($_POST['input_city'] != '') {
             $save['input_city'] = t($_POST['input_city']);
             $save['city'] = 0;
             $save['area'] = 0;
         } else {
             isset($cityIds[1]) && ($save['city'] = intval($cityIds[1]));
             isset($cityIds[2]) && ($save['area'] = intval($cityIds[2]));
         }
         // 修改用户昵称
         $uname = t($_POST['uname']);
         $oldName = t($_POST['old_name']);
         $save['uname'] = filter_keyword($uname);
         $res = model('Register')->isValidName($uname, $oldName);
         if (!$res) {
             $error = model('Register')->getLastError();
             return $this->ajaxReturn(null, model('Register')->getLastError(), $res);
         }
         // 如果包含中文将中文翻译成拼音
         if (preg_match('/[\\x7f-\\xff]+/', $save['uname'])) {
             // 昵称和呢称拼音保存到搜索字段
             $save['search_key'] = $save['uname'] . ' ' . model('PinYin')->Pinyin($save['uname']);
         } else {
             $save['search_key'] = $save['uname'];
         }
         /* 用户首字母 */
         $save['first_letter'] = getShortPinyin($save['uname']);
         $res = model('User')->where("`uid`={$this->mid}")->save($save);
         $res && model('User')->cleanCache($this->mid);
         $user_feeds = model('Feed')->where('uid=' . $this->mid)->field('feed_id')->findAll();
         if ($user_feeds) {
             $feed_ids = getSubByKey($user_feeds, 'feed_id');
             model('Feed')->cleanCache($feed_ids, $this->mid);
         }
     }
     // 保存用户资料配置字段
     false !== $res && ($res = $this->_profile_model->saveUserProfile($this->mid, $_POST));
     // 保存用户标签信息
     $tagIds = t($_REQUEST['user_tags']);
     // 注册配置信息
     $this->_config = model('Xdata')->get('admin_Config:register');
     if (!empty($tagIds)) {
         $tagIds = explode(',', $tagIds);
         $rowId = intval($this->mid);
         if (!empty($rowId)) {
             $registerConfig = model('Xdata')->get('admin_Config:register');
             if (count($tagIds) > $registerConfig['tag_num']) {
                 return $this->ajaxReturn(null, '最多只能设置' . $registerConfig['tag_num'] . '个标签', false);
             }
             model('Tag')->setAppName('public')->setAppTable('user')->updateTagData($rowId, $tagIds);
         }
     } elseif (empty($tagIds) && isset($_REQUEST['user_tags'])) {
         return $this->ajaxReturn(null, '请至少选择一个标签', false);
     }
     $result = $this->ajaxReturn(null, $this->_profile_model->getError(), $res);
     return $this->ajaxReturn(null, $this->_profile_model->getError(), $res);
 }