|
|
@@ -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{ |
|
|
|