diff --git a/modules/sociaty/api_cross_agree.go b/modules/sociaty/api_cross_agree.go index 9969e98a1..1fdb46ad6 100644 --- a/modules/sociaty/api_cross_agree.go +++ b/modules/sociaty/api_cross_agree.go @@ -2,9 +2,11 @@ package sociaty import ( "errors" + "fmt" "go_dreamfactory/comm" "go_dreamfactory/lego/sys/log" "go_dreamfactory/pb" + "go_dreamfactory/utils" ) // 公会申请-同意 @@ -25,6 +27,26 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.SociatyAgreeReq) ( return } + // userex + userEx, err := this.module.ModuleUser.GetUserExpand(req.Uid) + if err != nil { + this.module.Error("GetRemoteUserExpand", log.Field{Key: "uid", Value: req.Uid}, log.Field{Key: "err", Value: err.Error()}) + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_UserNofound, + Title: pb.ErrorCode_UserNofound.ToString(), + } + return + } + + if utils.IsInCDHour(userEx.SociatyCd) { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_SociatyCDLimit, + Title: pb.ErrorCode_SociatyCDLimit.ToString(), + Message: fmt.Sprintf("CD内[%v]不允许申请", userEx.SociatyCd), + } + return + } + uid := session.GetUserId() sociaty := this.module.modelSociaty.getUserSociaty(uid) if sociaty == nil {