|
@@ -589,6 +589,11 @@ func MyFans(c *gin.Context) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
type ActiveInfo struct { |
|
|
|
|
|
model.UserRelate `xorm:"extends"` |
|
|
|
|
|
model.EggSignIn `xorm:"extends"` |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// MyFansUserList |
|
|
// MyFansUserList |
|
|
// @Summary 蛋蛋星球-添加好友-粉丝团队-我的粉丝-在线好友列表(获取) |
|
|
// @Summary 蛋蛋星球-添加好友-粉丝团队-我的粉丝-在线好友列表(获取) |
|
|
// @Tags 添加好友 |
|
|
// @Tags 添加好友 |
|
@@ -668,13 +673,26 @@ func MyFansUserList(c *gin.Context) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
session := db.Db.Table("user_relate"). |
|
|
|
|
|
Join("LEFT OUTER", "user", "user_relate.uid = user.id"). |
|
|
|
|
|
Join("LEFT OUTER", "egg_sign_in", "user_relate.uid = egg_sign_in.uid") |
|
|
|
|
|
if len(userRelatesUids) > 0 { |
|
|
|
|
|
session.In("user_relate.uid", userRelatesUids) |
|
|
|
|
|
} |
|
|
|
|
|
session.And("user_relate.parent_uid = ?", user.Id) |
|
|
|
|
|
session.And("egg_sign_in.start_time > ?", startTime) |
|
|
|
|
|
session.And("egg_sign_in.is_completed = 0") |
|
|
|
|
|
activityUserNums, err := session.Count(&ActiveInfo{}) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
scheme, domain := svc.ImageBucket(db.Db) |
|
|
scheme, domain := svc.ImageBucket(db.Db) |
|
|
var data []md.OneLineUserNode |
|
|
var data []md.OneLineUserNode |
|
|
var activityUserNums int |
|
|
|
|
|
for _, v := range results { |
|
|
for _, v := range results { |
|
|
isOnline := false |
|
|
isOnline := false |
|
|
if userSignInMap[utils.AnyToInt64(v["uid"])] != nil { |
|
|
if userSignInMap[utils.AnyToInt64(v["uid"])] != nil { |
|
|
activityUserNums++ |
|
|
|
|
|
isOnline = true |
|
|
isOnline = true |
|
|
} |
|
|
} |
|
|
tempUrl := svc.ImageFormatWithBucket(scheme, domain, v["avatar"]) |
|
|
tempUrl := svc.ImageFormatWithBucket(scheme, domain, v["avatar"]) |
|
@@ -688,7 +706,7 @@ func MyFansUserList(c *gin.Context) { |
|
|
|
|
|
|
|
|
resp := md.MyFansUserListResp{ |
|
|
resp := md.MyFansUserListResp{ |
|
|
InviteTotal: inviteTotal, |
|
|
InviteTotal: inviteTotal, |
|
|
ActivityUserNums: activityUserNums, |
|
|
|
|
|
|
|
|
ActivityUserNums: int(activityUserNums), |
|
|
List: data, |
|
|
List: data, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|