diff --git a/_const/enum/msg_e/msg.go b/_const/enum/msg_e/msg.go index 83caf2dd5be74c38373ec9267d8566bf0bdd0f23..c06ab13b2d247ca7089c990aa060d1708f280ca9 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 52c382c7c1af8c6a526bc81e0615597ae1fd1cad..c3d36952ffe842c9c4c4eabe46170a119d55b862 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 8900f16bdfeede06fb3d59f25d9d75490fc265ed..af6fdd8989c709201fd0ffc5795d9895496c4439 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 f8f4d5f312cf1d2a51e89b4a479967c80f960529..055d8b791c9174138ced0881b9207751ce1b023d 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 }