查询其他玩家战斗记录
This commit is contained in:
parent
2bb2f2710d
commit
712531131d
@ -30,7 +30,7 @@ func (this *apiComp) QueryRecord(session comm.IUserSession, req *pb.PagodaQueryR
|
||||
list.Type = comm.PagodaType
|
||||
this.module.modelPagoda.addNewPagoda(session.GetUserId(), list)
|
||||
} else {
|
||||
record = this.module.modelPagoda.getPagodaRankList(session.GetUserId(), list.PagodaId)
|
||||
record = this.module.modulerank.getPagodaRankListByFloorid(session.GetUserId(), list.PagodaId)
|
||||
}
|
||||
session.SendMsg(string(this.module.GetType()), PagodaQueryRecordResp, &pb.PagodaQueryRecordResp{Data: record})
|
||||
return
|
||||
|
@ -53,17 +53,3 @@ func (this *ModelPagoda) addNewPagoda(uId string, data *pb.DBPagoda) (err error)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (this *ModelPagoda) getPagodaRankList(uid string, floorid int32) *pb.DBPagodaRecord {
|
||||
pagodaRank := make([]*pb.DBPagodaRecord, 0)
|
||||
err := this.GetList(uid, &pagodaRank)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
for _, v := range pagodaRank {
|
||||
if v.PagodaId == floorid {
|
||||
return v
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -177,3 +177,17 @@ func (this *ModelRank) ChangeFloorRankList(session comm.IUserSession, floor int3
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (this *ModelRank) getPagodaRankListByFloorid(uid string, floorid int32) *pb.DBPagodaRecord {
|
||||
pagodaRank := make([]*pb.DBPagodaRecord, 0)
|
||||
err := this.GetList(uid, &pagodaRank)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
for _, v := range pagodaRank {
|
||||
if v.PagodaId == floorid {
|
||||
return v
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ func (this *Pagoda) CheckUserBasePagodaInfo(uid string) (data *pb.DBPagodaRecord
|
||||
|
||||
list, _ := this.modelPagoda.getPagodaList(uid)
|
||||
if list != nil { // redis没有数据
|
||||
data = this.modelPagoda.getPagodaRankList(uid, list.PagodaId)
|
||||
data = this.modulerank.getPagodaRankListByFloorid(uid, list.PagodaId)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user