From b5f807a000636f4d81187085898dc0f1e22c6eea Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Mon, 27 Mar 2023 10:23:08 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=8A=A0=E5=85=A5=E5=AE=B6?= =?UTF-8?q?=E6=97=8F=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _const/enum/msg_e/msg.go | 1 + domain/model/groupPower_m/groupPower.go | 10 ++++++++++ mysql/3.5.0.sql | 15 +++++++++++++++ route/group_power_r/group_power.go | 11 +++++++++++ 4 files changed, 37 insertions(+) diff --git a/_const/enum/msg_e/msg.go b/_const/enum/msg_e/msg.go index 83caf2d..c06ab13 100644 --- a/_const/enum/msg_e/msg.go +++ b/_const/enum/msg_e/msg.go @@ -134,6 +134,7 @@ const ( GroupPowerUpgrade = 48 // 家族升级 GroupPowerExpireNotice = 49 // 家族等级即将过期(每月20日) GroupPowerWelcomeJoin = 53 // 欢迎加入家族 + GroupPowerApplyJoinMsg = 54 // 申请加入家族通知 ) type MsgSysUserType = mysql.Type diff --git a/domain/model/groupPower_m/groupPower.go b/domain/model/groupPower_m/groupPower.go index 52c382c..c3d3695 100644 --- a/domain/model/groupPower_m/groupPower.go +++ b/domain/model/groupPower_m/groupPower.go @@ -471,6 +471,16 @@ func GetGroupPowerMgr(model *domain.Model, groupPowerId mysql.ID) (mysql.ID, err return groupPowerUser.UserId, nil } +//获取势力主和管理员 +func GetGroupPowerMgrList(model *domain.Model, groupPowerId mysql.ID) ([]mysql.ID, error) { + res := make([]mysql.ID, 0) + err := model.Db.Model(GroupPowerUser{}).Select("user_id").Where("group_power_id = ? and role in (2,3)", groupPowerId).Scan(res).Error + if err != nil { + return res, myerr.WrapErr(err) + } + return res, nil +} + //运营平台让用户离开 func (groupPower *GroupPower) MgrUserLeave(userId mysql.ID) (*GroupPowerUser, error) { // diff --git a/mysql/3.5.0.sql b/mysql/3.5.0.sql index 8900f16..af6fdd8 100644 --- a/mysql/3.5.0.sql +++ b/mysql/3.5.0.sql @@ -72,3 +72,18 @@ VALUES ('zh', '', '你已加入家族,和朋友们一起快乐玩耍吧!', ' ('hi', '', 'आप परिवार में शामिल हो गए हैं, आइए अपने दोस्तों के साथ मस्ती करें!', '', 1, 53, 0, ''), ('vi', '', 'Bạn đã tham gia gia đình, hãy vui vẻ với bạn bè của bạn!', '', 1, 53, 0, ''), ('ur', '', 'آپ خاندان میں شامل ہو گئے ہیں، آئیے اپنے دوستوں کے ساتھ مزے کریں!', '', 1, 53, 0, ''); + +INSERT INTO hilo.res_msg_translate (`language`, title, content, icon_url, msg_type, `type`, action_type, action_url) +VALUES ('zh', '', '有新朋友申请加入你的家族叻,请尽快审核。', '', 1, 54, 0, ''), + ('en', '', 'There are new friends applying to join your family, please review as soon as possible.', '', 1, 54,0, ''), + ('ar', '', 'هناك أصدقاء جدد يتقدمون للانضمام إلى عائلتك ، يرجى المراجعة في أقرب وقت ممكن.', '', 1, 54, 0, ''), + ('tr', '', 'Ailenize katılmak için başvuran yeni arkadaşlar var, lütfen en kısa zamanda gözden geçirin.', '', 1,54, 0, ''), + ('id', '', 'Ada teman baru yang melamar untuk bergabung dengan keluarga Anda, harap tinjau sesegera mungkin.','', 1, 54, 0, ''), + ('ru', '', 'Есть новые друзья, подающие заявку на присоединение к вашей семье, пожалуйста, просмотрите их как можно скорее.', '', 1, 54, 0, ''), + ('ko', '', '가족에 가입하려는 새로운 친구가 있습니다. 가능한 한 빨리 검토하십시오.', '', 1, 54, 0, ''), + ('pt', '', 'Há novos amigos se inscrevendo para se juntar à sua família, revise o mais rápido possível.', '', 1, 54, 0, ''), + ('th', '', 'มีเพื่อนใหม่สมัครเข้าร่วมครอบครัวของคุณ โปรดตรวจสอบโดยเร็วที่สุด', '', 1, 54, 0, ''), + ('ca', '', 'Hay nuevos amigos que solicitan unirse a su familia, revíselos lo antes posible.', '', 1, 54, 0, ''), + ('hi', '', 'आपके परिवार में शामिल होने के लिए नए मित्र आवेदन कर रहे हैं, कृपया जल्द से जल्द समीक्षा करें।', '', 1, 54, 0, ''), + ('vi', '', 'Có những người bạn mới đăng ký tham gia gia đình của bạn, vui lòng xem xét càng sớm càng tốt.', '', 1, 54, 0, ''), + ('ur', '', 'آپ کے خاندان میں شامل ہونے کے لیے نئے دوست درخواست دے رہے ہیں، براہ کرم جلد از جلد جائزہ لیں۔', '', 1, 54, 0, ''); \ No newline at end of file diff --git a/route/group_power_r/group_power.go b/route/group_power_r/group_power.go index f8f4d5f..055d8b7 100644 --- a/route/group_power_r/group_power.go +++ b/route/group_power_r/group_power.go @@ -994,6 +994,17 @@ func GroupPowerApplyJoin(c *gin.Context) (*mycontext.MyContext, error) { return myContext, err } + // 找到家族管理员们 + mgrList, err := groupPower_m.GetGroupPowerMgrList(model, gpInfo.ID) + if err != nil { + model.Log.Errorf("GroupPowerApplyJoin err:%v, id:%v", err, gpInfo.ID) + } else { + for _, v := range mgrList { + // 发小助手通知用户 + go msg.SendLittleAssistantMsg(model, v, msg_e.GroupPowerApplyJoinMsg, "", "", "", "", "") + } + + } resp.ResponseOk(c, nil) return myContext, nil } -- 2.22.0