diff --git a/modules/sociaty/model_sociaty.go b/modules/sociaty/model_sociaty.go index 9014a9a4b..d5e472734 100644 --- a/modules/sociaty/model_sociaty.go +++ b/modules/sociaty/model_sociaty.go @@ -197,33 +197,39 @@ func (this *ModelSociaty) getUserSociaty(uid string) (sociaty *pb.DBSociaty) { ) if this.moduleSociaty.IsCross() { userEx, err = this.moduleSociaty.ModuleUser.GetRemoteUserExpand(uid) + if err != nil { + log.Errorf("GetUserExpand uid:%v err:%v", uid, err) + return + } + if userEx.SociatyId != "" { + sociaty = this.getSociaty(userEx.SociatyId) + if sociaty.Id != "" { + //验证是否解散 + if this.isDismiss(sociaty) { + sociaty.Id = "" + } + } + } } else { userEx, err = this.moduleSociaty.ModuleUser.GetUserExpand(uid) - sociaty = &pb.DBSociaty{} - if err = this.moduleSociaty.service.AcrossClusterRpcCall( - context.Background(), - this.moduleSociaty.GetCrossTag(), - comm.Service_Worker, - string(comm.Rpc_ModuleFriendUseAssitHero), - pb.RPCGeneralReqA1{Param1: userEx.SociatyId}, - sociaty); err != nil { - this.moduleSociaty.Errorln(err) + if err != nil { + log.Errorf("GetUserExpand uid:%v err:%v", uid, err) + return } - } - if err != nil { - log.Errorf("GetUserExpand uid:%v err:%v", uid, err) - return - } - - if userEx.SociatyId != "" { - sociaty = this.getSociaty(userEx.SociatyId) - if sociaty.Id != "" { - //验证是否解散 - if this.isDismiss(sociaty) { - sociaty.Id = "" + if userEx.SociatyId != "" { + sociaty = &pb.DBSociaty{} + if err = this.moduleSociaty.service.AcrossClusterRpcCall( + context.Background(), + this.moduleSociaty.GetCrossTag(), + comm.Service_Worker, + string(comm.Rpc_ModuleSociaty), + pb.RPCGeneralReqA1{Param1: userEx.SociatyId}, + sociaty); err != nil { + this.moduleSociaty.Errorln(err) } } } + return } diff --git a/modules/sociaty/module.go b/modules/sociaty/module.go index 31bff1d03..a7712a9fe 100644 --- a/modules/sociaty/module.go +++ b/modules/sociaty/module.go @@ -114,6 +114,7 @@ func (this *Sociaty) Reddot(uid string, rid ...comm.ReddotType) (reddot map[comm // 跨服获取公会 func (this *Sociaty) RpcGetSociaty(ctx context.Context, req *pb.RPCGeneralReqA1, reply *pb.DBSociaty) error { this.Debug("Rpc_ModuleSociaty", log.Field{Key: "req", Value: req}) - reply = this.modelSociaty.getSociaty(req.Param1) + sociaty := this.modelSociaty.getSociaty(req.Param1) + *reply = *sociaty return nil }