循环塔赛季结束清理
This commit is contained in:
parent
704ac9b16d
commit
715a697aac
@ -21,7 +21,7 @@ func (this *apiComp) GetCycle(session comm.IUserSession, req *pb.PagodaGetCycleR
|
|||||||
err error
|
err error
|
||||||
update map[string]interface{}
|
update map[string]interface{}
|
||||||
)
|
)
|
||||||
|
update = make(map[string]interface{}, 0)
|
||||||
list, err = this.module.modelCyclePagoda.getPagodaCycleList(session.GetUserId())
|
list, err = this.module.modelCyclePagoda.getPagodaCycleList(session.GetUserId())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
@ -38,13 +38,22 @@ func (this *apiComp) GetCycle(session comm.IUserSession, req *pb.PagodaGetCycleR
|
|||||||
update["rtime"] = list.Etime
|
update["rtime"] = list.Etime
|
||||||
list.Itype = data.Itype
|
list.Itype = data.Itype
|
||||||
update["itype"] = list.Itype
|
update["itype"] = list.Itype
|
||||||
|
list.Data = make(map[int32]*pb.CycleData)
|
||||||
|
update["data"] = list.Data
|
||||||
|
list.Maxfloor = 0
|
||||||
|
update["maxfloor"] = list.Maxfloor
|
||||||
|
list.Battlecount = 0
|
||||||
|
update["battlecount"] = list.Battlecount
|
||||||
|
list.Rtime = configure.Now().Unix()
|
||||||
|
update["rtime"] = list.Rtime
|
||||||
}
|
}
|
||||||
if !utils.IsToday(list.Rtime) {
|
if !utils.IsToday(list.Rtime) {
|
||||||
update = make(map[string]interface{}, 0)
|
|
||||||
list.Rtime = configure.Now().Unix()
|
list.Rtime = configure.Now().Unix()
|
||||||
list.Battlecount = 0
|
list.Battlecount = 0
|
||||||
update["battlecount"] = list.Battlecount
|
update["battlecount"] = list.Battlecount
|
||||||
update["rtime"] = list.Rtime
|
update["rtime"] = list.Rtime
|
||||||
|
}
|
||||||
|
if len(update) > 0 {
|
||||||
if err = this.module.modelCyclePagoda.ModifyPagodaCycleData(session.GetUserId(), update); err != nil {
|
if err = this.module.modelCyclePagoda.ModifyPagodaCycleData(session.GetUserId(), update); err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_DBError,
|
Code: pb.ErrorCode_DBError,
|
||||||
|
Loading…
Reference in New Issue
Block a user