From 19503c55911fad4a7e544cc0017890bd47c4361c Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Mon, 12 Jun 2023 13:54:29 +0800 Subject: [PATCH 1/3] update --- consume/dou_shen_user_register_for_my_my_recommender.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 e84b262..095ee36 100644 --- a/consume/dou_shen_user_register_for_my_my_recommender.go +++ b/consume/dou_shen_user_register_for_my_my_recommender.go @@ -159,7 +159,7 @@ func handleDouShenUserRegisterConsumeForMyRecommender(msgData []byte) error { //插入 dou_shen_im_group 记录 now := time.Now() _, err = db.DouShenImGroupInsert(db.Db, &model2.DouShenImGroup{ - Kind: 1, + Kind: 3, Uid: int(msg.RecommenderUid), GroupId: int(resp.GroupId), IsFull: 0, From 347b003d5adf8569e5c0999ab2fc3c94b0b6a7f9 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Mon, 12 Jun 2023 20:51:21 +0800 Subject: [PATCH 2/3] update --- consume/dou_shen_user_register_for_official_consume.go | 6 ++---- 1 file changed, 2 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 f2bd336..8fd6c6a 100644 --- a/consume/dou_shen_user_register_for_official_consume.go +++ b/consume/dou_shen_user_register_for_official_consume.go @@ -122,15 +122,13 @@ func handleDouShenUserRegisterConsumeForOfficial(msgData []byte) error { } for _, group := range *officialGroups { //统计当前群有多少人 - userGroups, err := db2.GroupUserFindByParams(db.ImDb, map[string]interface{}{ + userGroups, _ := db2.GroupUserFindByParams(db.ImDb, map[string]interface{}{ "key": "group_id", "value": group.GroupId, }) - if err != nil { - return err - } if len(*userGroups) < 500 { officialGroup = &group + break } } From 5c3d209c7b7ed8ce406c61f797d41575a1e71dd1 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Tue, 13 Jun 2023 11:22:56 +0800 Subject: [PATCH 3/3] update --- ...shen_user_register_for_official_consume.go | 4 +- ...shen_user_register_for_operation_center.go | 69 ++++++++++--------- 2 files changed, 38 insertions(+), 35 deletions(-) diff --git a/consume/dou_shen_user_register_for_official_consume.go b/consume/dou_shen_user_register_for_official_consume.go index 8fd6c6a..bb47638 100644 --- a/consume/dou_shen_user_register_for_official_consume.go +++ b/consume/dou_shen_user_register_for_official_consume.go @@ -121,6 +121,9 @@ func handleDouShenUserRegisterConsumeForOfficial(msgData []byte) error { return err } for _, group := range *officialGroups { + if officialGroup != nil { + continue + } //统计当前群有多少人 userGroups, _ := db2.GroupUserFindByParams(db.ImDb, map[string]interface{}{ "key": "group_id", @@ -128,7 +131,6 @@ func handleDouShenUserRegisterConsumeForOfficial(msgData []byte) error { }) if len(*userGroups) < 500 { officialGroup = &group - break } } diff --git a/consume/dou_shen_user_register_for_operation_center.go b/consume/dou_shen_user_register_for_operation_center.go index 7374405..f27df4b 100644 --- a/consume/dou_shen_user_register_for_operation_center.go +++ b/consume/dou_shen_user_register_for_operation_center.go @@ -6,6 +6,7 @@ import ( db2 "applet/app/db/gim" "applet/app/db/gim/model" model2 "applet/app/db/model" + "applet/app/svc" utils2 "applet/app/utils" "applet/app/utils/logx" utils "applet/app/utils/rpc" @@ -212,40 +213,40 @@ func handleDouShenUserRegisterConsumeForOperationCenter(msgData []byte) error { }) //发送专属红包 - //gimSendSpeciallyRedPackageUser, err := db2.DbSysCfg.SysCfgGetOne("send_specially_red_package_user", msg.MasterId) - //if err != nil { - // return err - //} - //if gimSendSpeciallyRedPackageUser == nil { - // return errors.New("暂未设置专属红包发送用户") - //} - //sendSpeciallyRedPackageUser, err := db.SysCfgGetOne(db.DBs[msg.MasterId], "send_specially_red_package_user") - //if err != nil { - // return err - //} - //amount, err := getSendAmount(msg.MasterId) - //if err != nil { - // return err - //} - //args := md.SendRedPackageReq{ - // UserId: gimSendSpeciallyRedPackageUser.Val, - // DeviceId: "", - // Token: "", - // Amount: amount, - // RedPacketType: 5, - // RedPacketNums: 1, - // RedPacketContent: "抖省赚钱,大吉大利", - // RedPacketSmallContent: gimUser.Nickname + "的专属红包", - // ReceiverType: 2, - // ReceiverId: int64(OperationGroup.GroupId), - // SendTime: utils2.UnixMilliTime(time.Now()), - // ToUserIds: []int64{gimUser.Id}, - // RedPackageCover: "", - //} - //err, _ = svc.CurlSendRedPackage(args, msg.MasterId, sendSpeciallyRedPackageUser.Val) - //if err != nil { - // return err - //} + gimSendSpeciallyRedPackageUser, err := db2.DbSysCfg.SysCfgGetOne("send_specially_red_package_user", msg.MasterId) + if err != nil { + return err + } + if gimSendSpeciallyRedPackageUser == nil { + return errors.New("暂未设置专属红包发送用户") + } + sendSpeciallyRedPackageUser, err := db.SysCfgGetOne(db.DBs[msg.MasterId], "send_specially_red_package_user") + if err != nil { + return err + } + amount, err := getSendAmount(msg.MasterId) + if err != nil { + return err + } + args := md.SendRedPackageReq{ + UserId: gimSendSpeciallyRedPackageUser.Val, + DeviceId: "", + Token: "", + Amount: amount, + RedPacketType: 5, + RedPacketNums: 1, + RedPacketContent: "抖省赚钱,大吉大利", + RedPacketSmallContent: gimUser.Nickname + "的专属红包", + ReceiverType: 2, + ReceiverId: int64(OperationGroup.GroupId), + SendTime: utils2.UnixMilliTime(time.Now()), + ToUserIds: []int64{gimUser.Id}, + RedPackageCover: "", + } + err, _ = svc.CurlSendRedPackage(args, msg.MasterId, sendSpeciallyRedPackageUser.Val) + if err != nil { + return err + } return nil }