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
a80e1c20
Commit
a80e1c20
authored
Mar 10, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
推全部获取家族成员
parent
46d29706
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
group_info.go
domain/model/groupPower_m/group_info.go
+9
-0
event_init.go
domain/service/event_s/event_init.go
+12
-7
No files found.
domain/model/groupPower_m/group_info.go
View file @
a80e1c20
...
@@ -46,3 +46,12 @@ func MGetGroupPowerUsers(model *domain.Model, groupPowerIds []mysql.ID) (map[mys
...
@@ -46,3 +46,12 @@ func MGetGroupPowerUsers(model *domain.Model, groupPowerIds []mysql.ID) (map[mys
}
}
return
res
,
nil
return
res
,
nil
}
}
// 获取家族成员
func
GetGroupPowerUser
(
model
*
domain
.
Model
,
groupPowerId
mysql
.
ID
)
([]
*
GroupPowerUser
,
error
)
{
m
,
err
:=
MGetGroupPowerUsers
(
model
,
[]
mysql
.
ID
{
groupPowerId
})
if
err
!=
nil
{
return
nil
,
err
}
return
m
[
groupPowerId
],
nil
}
domain/service/event_s/event_init.go
View file @
a80e1c20
...
@@ -170,20 +170,25 @@ func GroupPowerEvents() {
...
@@ -170,20 +170,25 @@ func GroupPowerEvents() {
return
nil
return
nil
}
}
model
.
Log
.
Infof
(
"msg AddGroupPowerUpgradeAsync GroupPowerId:%v"
,
event
.
GroupPowerId
)
model
.
Log
.
Infof
(
"msg AddGroupPowerUpgradeAsync GroupPowerId:%v"
,
event
.
GroupPowerId
)
//获取势力主
users
,
err
:=
groupPower_m
.
GetGroupPowerUser
(
model
,
event
.
GroupPowerId
)
mgrUserId
,
err
:=
groupPower_m
.
GetGroupPowerMgr
(
model
,
event
.
GroupPowerId
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
mgrUser
,
err
:=
user_m
.
GetUser
(
model
,
mgrUserId
)
var
userIds
[]
mysql
.
ID
for
_
,
u
:=
range
users
{
userIds
=
append
(
userIds
,
u
.
UserId
)
}
userMaps
,
err
:=
user_m
.
GetUserMapByIds
(
model
,
userIds
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
if
err
:=
msg_m
.
NewUserRecord
(
model
,
mgrUserId
,
msg_e
.
GroupPowerUpgrade
,
""
,
0
,
""
,
""
,
""
,
""
,
""
)
.
Persistent
();
err
!=
nil
{
for
uid
,
u
:=
range
userMaps
{
if
err
:=
msg_m
.
NewUserRecord
(
model
,
uid
,
msg_e
.
GroupPowerUpgrade
,
""
,
0
,
""
,
""
,
""
,
""
,
""
)
.
Persistent
();
err
!=
nil
{
model
.
Log
.
Errorf
(
"msg AddGroupPowerLeaveAsync NewUserRecord err:%v"
,
err
)
model
.
Log
.
Errorf
(
"msg AddGroupPowerLeaveAsync NewUserRecord err:%v"
,
err
)
return
nil
return
nil
}
}
msg_m
.
SendEmasMsgAssistant
(
model
,
mgrUser
.
ExternalId
,
mgrUser
.
DeviceType
)
msg_m
.
SendEmasMsgAssistant
(
model
,
u
.
ExternalId
,
u
.
DeviceType
)
}
return
nil
return
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