From 22bcc92e0dc3e09c89c01fd0869968ce2f7212a6 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 23 Jan 2024 17:37:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=98=E6=96=97=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/plunder/api_challengeover.go | 2 +- modules/plunder/api_pvpchallengeover.go | 4 ++-- modules/plunder/model_record.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/plunder/api_challengeover.go b/modules/plunder/api_challengeover.go index f5df47973..fbbcfe397 100644 --- a/modules/plunder/api_challengeover.go +++ b/modules/plunder/api_challengeover.go @@ -238,7 +238,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PlunderCha Cid: list.Source[req.Index], Ctime: configure.Now().Unix() + int64(conf.Extime), }) - err = this.module.modelRecord.AddRecordData(session.GetUserId(), info) + err = this.module.modelRecord.AddRecordData(land.Id, info) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "PlunderChallengeOverReq", atno) }) diff --git a/modules/plunder/api_pvpchallengeover.go b/modules/plunder/api_pvpchallengeover.go index bbbf7d9e5..5c53f1766 100644 --- a/modules/plunder/api_pvpchallengeover.go +++ b/modules/plunder/api_pvpchallengeover.go @@ -107,7 +107,7 @@ func (this *apiComp) PvpChallengeOver(session comm.IUserSession, req *pb.Plunder Cid: land.Ship[req.Oid].Line.Cid, Ctime: configure.Now().Unix(), }) - err = this.module.modelRecord.AddRecordData(session.GetUserId(), info) + err = this.module.modelRecord.AddRecordData(land.Id, info) return } @@ -146,6 +146,6 @@ func (this *apiComp) PvpChallengeOver(session comm.IUserSession, req *pb.Plunder Cid: land.Ship[req.Oid].Line.Cid, Ctime: configure.Now().Unix(), }) - err = this.module.modelRecord.AddRecordData(session.GetUserId(), info) + err = this.module.modelRecord.AddRecordData(land.Id, info) return } diff --git a/modules/plunder/model_record.go b/modules/plunder/model_record.go index 93638922b..2b3b3727b 100644 --- a/modules/plunder/model_record.go +++ b/modules/plunder/model_record.go @@ -37,7 +37,7 @@ func (this *modelRecord) changePlunderRecordData(id string, update map[string]in // 新增一条记录 func (this *modelRecord) AddRecordData(id string, info []*pb.PlunderRecordData) (err error) { - if record, err := this.getPlunderRecordData(id); err != nil { + if record, err := this.getPlunderRecordData(id); err == nil { record.Data = append(record.Data, info...) err = this.changePlunderRecordData(id, map[string]interface{}{"data": record.Data}) }