From f182cef32d03e31082c27be1f824967a38893d39 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Mon, 19 Jun 2023 10:50:35 +0800 Subject: [PATCH] update --- consume/dou_shen_user_register_for_official_consume.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/consume/dou_shen_user_register_for_official_consume.go b/consume/dou_shen_user_register_for_official_consume.go index 0c9f4bc..3dfbd02 100644 --- a/consume/dou_shen_user_register_for_official_consume.go +++ b/consume/dou_shen_user_register_for_official_consume.go @@ -112,7 +112,7 @@ func handleDouShenUserRegisterConsumeForOfficial(msgData []byte) error { //2、查找是否有群 //officialGroup, err := db.DouShenImGroupGetOneByParamsForOfficial(db.Db, 1) - var officialGroup *model.DouShenImGroup + var officialGroup model.DouShenImGroup officialGroups, err := db.DouShenImGroupFindByParams(db.Db, map[string]interface{}{ "key": "kind", "value": 1, @@ -121,7 +121,7 @@ func handleDouShenUserRegisterConsumeForOfficial(msgData []byte) error { return err } for _, group := range *officialGroups { - if officialGroup != nil { + if officialGroup.GroupId != 0 { continue } //统计当前群有多少人 @@ -130,11 +130,11 @@ func handleDouShenUserRegisterConsumeForOfficial(msgData []byte) error { "value": group.GroupId, }) if len(*userGroups) < 500 { - officialGroup = &group + officialGroup = group } } - if officialGroup == nil { + if officialGroup.GroupId == 0 { groupName := "官方【" + utils2.AnyToString(len(*officialGroups)+1) + "】群" //3、创建群 resp, err := utils.GetLogicExtClient(cfg.ImLogicRpc.URL, cfg.ImLogicRpc.PORT).CreateGroup(utils.GetCtx("", strconv.FormatInt(gimUser.Id, 10), "0", msg.MasterId), &pb.CreateGroupReq{