Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-group
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujiebin
hilo-group
Commits
97cfda50
Commit
97cfda50
authored
Mar 27, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix/join msg
parent
d78e74f6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
1 deletion
+38
-1
msg.go
_const/enum/msg_e/msg.go
+1
-0
family.go
domain/model/groupPower_m/family.go
+1
-1
groupPower.go
domain/model/groupPower_m/groupPower.go
+10
-0
3.5.0.sql
mysql/3.5.0.sql
+15
-0
group_power.go
route/group_power_r/group_power.go
+11
-0
No files found.
_const/enum/msg_e/msg.go
View file @
97cfda50
...
...
@@ -134,6 +134,7 @@ const (
GroupPowerUpgrade
=
48
// 家族升级
GroupPowerExpireNotice
=
49
// 家族等级即将过期(每月20日)
GroupPowerWelcomeJoin
=
53
// 欢迎加入家族
GroupPowerApplyJoinMsg
=
54
// 申请加入家族通知
)
type
MsgSysUserType
=
mysql
.
Type
...
...
domain/model/groupPower_m/family.go
View file @
97cfda50
...
...
@@ -49,7 +49,7 @@ func (this *GroupPower) Get(model *domain.Model) (*GroupPower, error) {
func
(
gpu
*
GroupPowerUser
)
GetBy
(
model
*
domain
.
Model
,
pageSize
,
pageIndex
int
)
([]
*
GroupPowerUser
,
int64
,
int
,
bool
,
error
)
{
rows
:=
make
([]
*
GroupPowerUser
,
0
)
db
:=
model
.
Db
.
Model
(
GroupPowerUser
{})
.
Where
(
gpu
)
.
Order
(
"field(`role`, 2, 3, 1)"
)
db
:=
model
.
Db
.
Model
(
GroupPowerUser
{})
.
Where
(
gpu
)
.
Order
(
"field(`role`, 2, 3, 1)
,`id`
"
)
var
count
int64
err
:=
db
.
Count
(
&
count
)
.
Error
if
err
!=
nil
{
...
...
domain/model/groupPower_m/groupPower.go
View file @
97cfda50
...
...
@@ -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
)
{
//
...
...
mysql/3.5.0.sql
View file @
97cfda50
...
...
@@ -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
route/group_power_r/group_power.go
View file @
97cfda50
...
...
@@ -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
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment