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
52248445
Commit
52248445
authored
Aug 06, 2023
by
iamhujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:redis读取最近进房
parent
77fa9ad1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
19 deletions
+22
-19
group_list.go
route/group_r/group_list.go
+22
-19
No files found.
route/group_r/group_list.go
View file @
52248445
...
@@ -16,6 +16,7 @@ import (
...
@@ -16,6 +16,7 @@ import (
"hilo-group/cv/group_power_cv"
"hilo-group/cv/group_power_cv"
"hilo-group/cv/medal_cv"
"hilo-group/cv/medal_cv"
"hilo-group/cv/user_cv"
"hilo-group/cv/user_cv"
"hilo-group/domain/cache/group_c"
"hilo-group/domain/cache/res_c"
"hilo-group/domain/cache/res_c"
"hilo-group/domain/cache/room_c"
"hilo-group/domain/cache/room_c"
"hilo-group/domain/model/game_m"
"hilo-group/domain/model/game_m"
...
@@ -703,11 +704,12 @@ func GetRecentGroup(c *gin.Context) (*mycontext.MyContext, error) {
...
@@ -703,11 +704,12 @@ func GetRecentGroup(c *gin.Context) (*mycontext.MyContext, error) {
model
:=
domain
.
CreateModelContext
(
myContext
)
model
:=
domain
.
CreateModelContext
(
myContext
)
uer
:=
group_m
.
UserEnterRoom
{
UserId
:
userId
}
//uer := group_m.UserEnterRoom{UserId: userId}
rec
,
err
:=
uer
.
Find
(
model
.
Db
)
//rec, err := uer.Find(model.Db)
if
err
!=
nil
{
//if err != nil {
return
myContext
,
err
// return myContext, err
}
//}
rec
:=
group_c
.
GetUserRecentRooms
(
model
,
userId
)
myGroups
,
err
:=
group_m
.
FindGroupMapByOwner
(
model
,
userId
)
myGroups
,
err
:=
group_m
.
FindGroupMapByOwner
(
model
,
userId
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -716,9 +718,9 @@ func GetRecentGroup(c *gin.Context) (*mycontext.MyContext, error) {
...
@@ -716,9 +718,9 @@ func GetRecentGroup(c *gin.Context) (*mycontext.MyContext, error) {
// 剔除自己创建的群
// 剔除自己创建的群
groupIds
:=
make
([]
string
,
0
)
groupIds
:=
make
([]
string
,
0
)
for
_
,
i
:=
range
rec
{
for
_
,
groupId
:=
range
rec
{
if
_
,
ok
:=
myGroups
[
i
.
G
roupId
];
!
ok
{
if
_
,
ok
:=
myGroups
[
g
roupId
];
!
ok
{
groupIds
=
append
(
groupIds
,
i
.
G
roupId
)
groupIds
=
append
(
groupIds
,
g
roupId
)
}
}
}
}
...
@@ -827,19 +829,20 @@ func GetGroupVisitors(c *gin.Context) (*mycontext.MyContext, error) {
...
@@ -827,19 +829,20 @@ func GetGroupVisitors(c *gin.Context) (*mycontext.MyContext, error) {
return
myContext
,
err
return
myContext
,
err
}
}
uer
:=
group_m
.
UserEnterRoom
{
GroupId
:
groupId
}
//uer := group_m.UserEnterRoom{GroupId: groupId}
rows
,
err
:=
uer
.
Find
(
model
.
Db
)
//rows, err := uer.Find(model.Db)
if
err
!=
nil
{
//if err != nil {
return
myContext
,
err
// return myContext, err
}
//}
rows
:=
group_c
.
GetLastRoomVisitors
(
model
,
groupId
)
now
:=
time
.
Now
()
//
now := time.Now()
t
:=
now
.
AddDate
(
0
,
0
,
-
15
)
// 只要15天内进入房间的人
//
t := now.AddDate(0, 0, -15) // 只要15天内进入房间的人
userIds
:=
make
([]
uint64
,
0
)
userIds
:=
make
([]
uint64
,
0
)
for
_
,
i
:=
range
rows
{
for
_
,
u
:=
range
rows
{
if
i
.
EnterTime
.
After
(
t
)
{
//
if i.EnterTime.After(t) {
userIds
=
append
(
userIds
,
i
.
UserId
)
userIds
=
append
(
userIds
,
u
)
}
//
}
}
}
users
,
err
:=
user_m
.
GetUserMapByIds
(
model
,
userIds
)
users
,
err
:=
user_m
.
GetUserMapByIds
(
model
,
userIds
)
if
err
!=
nil
{
if
err
!=
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