diff --git a/consume/dou_shen_user_register_for_my_my_recommender.go b/consume/dou_shen_user_register_for_my_my_recommender.go index 952663f..b076df0 100644 --- a/consume/dou_shen_user_register_for_my_my_recommender.go +++ b/consume/dou_shen_user_register_for_my_my_recommender.go @@ -111,7 +111,7 @@ func handleDouShenUserRegisterConsumeForMyRecommender(msgData []byte) error { } //2、查找是否有群 - var fansGroup *model2.DouShenImGroup + var fansGroup model2.DouShenImGroup fansGroups, err := db.DouShenImGroupFindByParamsByKind(db.Db, 3, map[string]interface{}{ "key": "uid", "value": msg.RecommenderUid, @@ -129,11 +129,11 @@ func handleDouShenUserRegisterConsumeForMyRecommender(msgData []byte) error { return err } if len(*userGroups) < 500 { - fansGroup = &group + fansGroup = group } } - if fansGroup == nil { + if fansGroup.GroupId == 0 { recommenderUser, err := db.UserFindByID(db.DBs[msg.MasterId], msg.RecommenderUid) if err != nil { return err @@ -174,12 +174,13 @@ func handleDouShenUserRegisterConsumeForMyRecommender(msgData []byte) error { if err != nil { return err } - fansGroup, err = db.DouShenImGroupGetOneByParams(db.Db, 2, map[string]interface{}{ + tempFansGroup, err := db.DouShenImGroupGetOneByParams(db.Db, 2, map[string]interface{}{ "group_id": resp.GroupId, }) if err != nil { return err } + fansGroup = *tempFansGroup } userGroup, err2 := db2.GroupUserGetOneByParams(db.ImDb, 1, map[string]interface{}{ "key": "group_id", diff --git a/consume/dou_shen_user_register_for_operation_center.go b/consume/dou_shen_user_register_for_operation_center.go index fe4c6b6..0821c82 100644 --- a/consume/dou_shen_user_register_for_operation_center.go +++ b/consume/dou_shen_user_register_for_operation_center.go @@ -113,7 +113,7 @@ func handleDouShenUserRegisterConsumeForOperationCenter(msgData []byte) error { //2、查找是否有群 //OperationGroup, err := db.DouShenImGroupGetOneByParamsForFans(db.Db, 2, msg.OperationCenterUid) - var OperationGroup *model2.DouShenImGroup + var OperationGroup model2.DouShenImGroup operationGroups, err := db.DouShenImGroupFindByParamsByKind(db.Db, 2, map[string]interface{}{ "key": "uid", "value": msg.OperationCenterUid, @@ -131,11 +131,11 @@ func handleDouShenUserRegisterConsumeForOperationCenter(msgData []byte) error { return err } if len(*userGroups) < 500 { - OperationGroup = &group + OperationGroup = group } } - if OperationGroup == nil { + if OperationGroup.GroupId == 0 { //创建运营中心群 operationCenterUser, err := db.UserFindByID(db.DBs[msg.MasterId], msg.OperationCenterUid) if err != nil { @@ -188,12 +188,13 @@ func handleDouShenUserRegisterConsumeForOperationCenter(msgData []byte) error { if err != nil { return err } - OperationGroup, err = db.DouShenImGroupGetOneByParams(db.Db, 2, map[string]interface{}{ + tmpOperationGroup, err := db.DouShenImGroupGetOneByParams(db.Db, 2, map[string]interface{}{ "group_id": resp.GroupId, }) if err != nil { return err } + OperationGroup = *tmpOperationGroup } userGroup, err2 := db2.GroupUserGetOneByParams(db.ImDb, 1, map[string]interface{}{ "key": "group_id",