Browse Source

update

three
DengBiao 1 year ago
parent
commit
f182cef32d
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      consume/dou_shen_user_register_for_official_consume.go

+ 4
- 4
consume/dou_shen_user_register_for_official_consume.go View File

@@ -112,7 +112,7 @@ func handleDouShenUserRegisterConsumeForOfficial(msgData []byte) error {


//2、查找是否有群 //2、查找是否有群
//officialGroup, err := db.DouShenImGroupGetOneByParamsForOfficial(db.Db, 1) //officialGroup, err := db.DouShenImGroupGetOneByParamsForOfficial(db.Db, 1)
var officialGroup *model.DouShenImGroup
var officialGroup model.DouShenImGroup
officialGroups, err := db.DouShenImGroupFindByParams(db.Db, map[string]interface{}{ officialGroups, err := db.DouShenImGroupFindByParams(db.Db, map[string]interface{}{
"key": "kind", "key": "kind",
"value": 1, "value": 1,
@@ -121,7 +121,7 @@ func handleDouShenUserRegisterConsumeForOfficial(msgData []byte) error {
return err return err
} }
for _, group := range *officialGroups { for _, group := range *officialGroups {
if officialGroup != nil {
if officialGroup.GroupId != 0 {
continue continue
} }
//统计当前群有多少人 //统计当前群有多少人
@@ -130,11 +130,11 @@ func handleDouShenUserRegisterConsumeForOfficial(msgData []byte) error {
"value": group.GroupId, "value": group.GroupId,
}) })
if len(*userGroups) < 500 { if len(*userGroups) < 500 {
officialGroup = &group
officialGroup = group
} }
} }


if officialGroup == nil {
if officialGroup.GroupId == 0 {
groupName := "官方【" + utils2.AnyToString(len(*officialGroups)+1) + "】群" groupName := "官方【" + utils2.AnyToString(len(*officialGroups)+1) + "】群"
//3、创建群 //3、创建群
resp, err := utils.GetLogicExtClient(cfg.ImLogicRpc.URL, cfg.ImLogicRpc.PORT).CreateGroup(utils.GetCtx("", strconv.FormatInt(gimUser.Id, 10), "0", msg.MasterId), &pb.CreateGroupReq{ resp, err := utils.GetLogicExtClient(cfg.ImLogicRpc.URL, cfg.ImLogicRpc.PORT).CreateGroup(utils.GetCtx("", strconv.FormatInt(gimUser.Id, 10), "0", msg.MasterId), &pb.CreateGroupReq{


Loading…
Cancel
Save