增加同设备号,同ip号查询

dev_aagame_provider
zhora 1 month ago
parent 9508575d92
commit 503f342158
  1. 28
      call/user.go
  2. 2
      modules/backend/values/gameuser.go
  3. 8
      modules/customer/handler/guser/getGameUserInfo.go

@ -34,6 +34,34 @@ func GetUserInfo(uid int) (ret *common.PlayerDBInfo, err error) {
return
}
func GetUserByDeviceIp(ip, device string, withoutUid int) (uids []int) {
if ip == "" && device == "" {
log.Error("get user by device ip is nil, %d", withoutUid)
return
}
var users []common.PlayerDBInfo
db := db.Mysql().C().Model(&common.PlayerDBInfo{}).Select("id")
if ip != "" {
db = db.Where("ip = ?", ip)
}
if device != "" {
db = db.Where("deviceid = ?", device)
}
if withoutUid != 0 {
db = db.Where("id != ?", withoutUid)
}
err := db.Find(&users).Error
if err != nil {
log.Error("get user by device ip err, %s", err.Error())
return
}
uids = make([]int, 0, len(users))
for _, v := range users {
uids = append(uids, v.Id)
}
return
}
// 查询用户的信息
func GetUserXInfo(uid int, fields ...string) (ret *common.PlayerDBInfo, err error) {
ret = new(common.PlayerDBInfo)

@ -166,6 +166,8 @@ type GetGameUserInfoV1Resp struct {
Gpsadid string
SubAccount []int
Rtp int
SameIPUids []int
SameDeviceUids []int
}
type UserGameInfo struct {

@ -114,9 +114,11 @@ func GetGameUserInfo(c *gin.Context) {
Status: user.Status,
Birth: user.Birth,
// PlayCount: util.GetGUserPlayCount(uid),
IP: user.IP,
LastLogin: user.LastLogin,
Tag: user.Tag,
IP: user.IP,
LastLogin: user.LastLogin,
Tag: user.Tag,
SameIPUids: call.GetUserByDeviceIp(user.IP, "", user.Id),
SameDeviceUids: call.GetUserByDeviceIp("", user.DeviceId, user.Id),
// IsFinishNewControl: control.NewControlFin == 2,
// NewControlLevel: control.NewControlLevel,
// ControlLevel: control.ControlLevel,

Loading…
Cancel
Save