From 459aefd62896f71f0ca4954ece2553699bec840a Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Mon, 19 Jun 2023 11:04:51 +0800 Subject: [PATCH] update --- consume/dou_shen_user_register_for_my_my_recommender.go | 9 +++++---- consume/dou_shen_user_register_for_operation_center.go | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) 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",