根据二度人脉推荐好友sql,推荐好友sql
friend表结构
DROP TABLE IF EXISTS FRIEND;
create table friend(
uid bigint not null comment '用户标识',
friend_uid bigint not null comment '申请加为好友的用户标识',
sys_create_date datetime not null comment '申请时间',
sys_last_update datetime not null comment '更新时间',
state tinyint not null comment '好友状态 0 : 删除, 1:申请好友, 2 : 好友',
primary key(uid, friend_uid)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '好友表';
select friend_uid from
friend where state=2 anduid in (select friend_uid from friend where uid=13 and state=2)
and friend_uid not in (select friend_uid from friend where uid=13 ) and friend_uid != 13 limit 6
uid为当前用户的ID,为id为13的用户查询二度人脉好友
您看到有些用户的校友里有显示一度人脉和二度人脉,是由于这些用户的校友已经升级为最新的朋友版本,升级后的朋友版本增加了行业、公司等相关的功能,不过目前朋友版本还处于内侧放量阶段,所以只有一部分用户有体验资格,如果您想要使用朋友版本的校友,您可以让已经升级为朋友版本的好友邀请您加入就可以了,还请您参考,真诚的希望可以帮助到您,谢谢!
1、进入校友网页点击页面右上角的“设置”—》“隐私设置”, 2、在隐私设置页面,可以对自己的资料、主页进行隐私设置,可以设置谁可以浏览查看我的信息,其中包括:所有用户可见、我的校友和我的好友可见、我的同班同学和我的好友可见、我的好友可见、我的同班同学可见、仅自己可见等;
3、同时还可以设置谁可以给我发小纸条和谁可以给我发好友申请等,同样包括:所有人、我的校友和好友、我的同班同学和我的好友、我的好友、我的同班同学、不接收。