修改获取好友列表及加入群组
This commit is contained in:
parent
a9d1d4542a
commit
2f9c8bea58
|
|
@ -180,12 +180,12 @@ func FindFriend(from_user_id, to_user_id int) []Friend {
|
||||||
type FriendRet struct {
|
type FriendRet struct {
|
||||||
ID int `json:"id"` //用户id
|
ID int `json:"id"` //用户id
|
||||||
Username string `json:"username"` //用户名
|
Username string `json:"username"` //用户名
|
||||||
Avatar string `json:"avatar"` //头像
|
Email string `json:"email"` //邮箱
|
||||||
}
|
}
|
||||||
|
|
||||||
func FindFriends(user_id int) []FriendRet {
|
func FindFriends(user_id int) []FriendRet {
|
||||||
var friends []FriendRet
|
var friends []FriendRet
|
||||||
DB.Debug().Raw("select users.id, users.username, users.avatar from users join friends on users.id = friends.friend_id where friends.user_id = ?", user_id).Scan(&friends)
|
DB.Debug().Raw("select users.id, users.name, users.email from users join friends on users.id = friends.friend_id where friends.user_id = ?", user_id).Scan(&friends)
|
||||||
return friends
|
return friends
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue