修复工会活跃的bug

This commit is contained in:
liwei 2023-07-13 16:51:10 +08:00
parent 8dd12dd6d3
commit 6921950914
4 changed files with 24 additions and 10 deletions

View File

@ -356,6 +356,8 @@ const ( //Rpc
Rpc_ModuleBuriedTrigger core.Rpc_Key = "Rpc_ModuleBuriedTrigger" //埋点跨服触发通知 Rpc_ModuleBuriedTrigger core.Rpc_Key = "Rpc_ModuleBuriedTrigger" //埋点跨服触发通知
Rpc_OpendCond core.Rpc_Key = "Rpc_OpendCond" Rpc_OpendCond core.Rpc_Key = "Rpc_OpendCond"
Rpc_ModuleWarorderSettlement core.Rpc_Key = "Rpc_ModuleWarorderSettlement" //战令结算
) )
// 事件类型定义处 // 事件类型定义处

View File

@ -68,7 +68,10 @@ func (this *apiComp) Activityreceive(session comm.IUserSession, req *pb.SociatyA
} }
return return
} }
// 发放个人奖励
if errdata = this.module.DispenseRes(session, conf.Reward, true); errdata != nil {
return
}
// 活跃度领取 // 活跃度领取
if err := this.module.modelSociatyTask.activityReceive(req.Id, sociaty.Id, uid); err != nil { if err := this.module.modelSociatyTask.activityReceive(req.Id, sociaty.Id, uid); err != nil {
this.module.Error("活跃度领取", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()}) this.module.Error("活跃度领取", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()})

View File

@ -1,6 +1,7 @@
package sociaty package sociaty
import ( import (
"fmt"
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log" "go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
@ -78,6 +79,13 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.SociatyReceiveRe
log.Field{Key: "taskId", Value: req.TaskId}, log.Field{Key: "taskId", Value: req.TaskId},
) )
} }
} else {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
Title: pb.ErrorCode_ConfigNoFound.ToString(),
Message: fmt.Sprintf("no found task conf:%d", req.TaskId),
}
return
} }
// 更新公会经验和活跃度 // 更新公会经验和活跃度

View File

@ -115,14 +115,15 @@ func (this *ModelSociatyTask) activityReceive(id int32, sociatyId, uid string) e
break break
} }
} }
if isUpdate {
if !isUpdate {
sociatyTask.ActivityList = append(sociatyTask.ActivityList, &pb.SociatyActivity{Id: id, Status: 1})
}
update := map[string]interface{}{ update := map[string]interface{}{
"activityList": sociatyTask.ActivityList, "activityList": sociatyTask.ActivityList,
} }
return this.ChangeList(sociatyId, uid, update) return this.ChangeList(sociatyId, uid, update)
} }
return nil
}
// 更新任务列表 // 更新任务列表
func (this *ModelSociatyTask) updateTaskList(sociatyId, uid string, taskList []*pb.SociatyTask) error { func (this *ModelSociatyTask) updateTaskList(sociatyId, uid string, taskList []*pb.SociatyTask) error {