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
1e4f388d
Commit
1e4f388d
authored
Apr 21, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
家族消息入口
parent
f7e473e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
group.go
cv/group_cv/group.go
+9
-8
groupMedal.go
domain/model/group_m/groupMedal.go
+5
-2
No files found.
cv/group_cv/group.go
View file @
1e4f388d
...
...
@@ -357,6 +357,15 @@ func BuildJoinedGroupInfo(myService *domain.Service, myUserId uint64, groupIds [
}
medals
:=
make
([]
medal_cv
.
PicElement
,
0
)
// 补上房间流水勋章
var
pe
*
medal_cv
.
PicElement
_
,
pe
,
err
=
medal_cv
.
GetGroupConsumeMedal
(
model
,
i
)
if
err
!=
nil
{
model
.
Log
.
Infof
(
"BuildJoinedGroupInfo: GetGroupConsumeMedal: %s"
,
err
.
Error
())
}
else
if
pe
!=
nil
{
medals
=
append
(
medals
,
medal_cv
.
PicElement
{
PicUrl
:
pe
.
PicUrl
})
}
// res_medal
if
m
,
ok
:=
groupMedals
[
i
];
ok
{
for
_
,
j
:=
range
m
{
mId
:=
uint32
(
j
)
...
...
@@ -367,14 +376,6 @@ func BuildJoinedGroupInfo(myService *domain.Service, myUserId uint64, groupIds [
}
}
}
// 补上房间流水勋章
var
pe
*
medal_cv
.
PicElement
_
,
pe
,
err
=
medal_cv
.
GetGroupConsumeMedal
(
model
,
i
)
if
err
!=
nil
{
model
.
Log
.
Infof
(
"BuildJoinedGroupInfo: GetGroupConsumeMedal: %s"
,
err
.
Error
())
}
else
if
pe
!=
nil
{
medals
=
append
(
medals
,
medal_cv
.
PicElement
{
PicUrl
:
pe
.
PicUrl
})
}
var
password
*
string
=
nil
if
len
(
g
.
Password
)
>
0
&&
g
.
Owner
!=
myUserId
{
...
...
domain/model/group_m/groupMedal.go
View file @
1e4f388d
...
...
@@ -3,9 +3,11 @@ package group_m
import
(
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/resource/mysql"
"git.hilo.cn/hilo-common/utils"
"gorm.io/gorm"
"gorm.io/gorm/clause"
"hilo-group/myerr"
"time"
)
//群组勋章
...
...
@@ -30,7 +32,6 @@ func (groupInfo *GroupInfo) GroupMedalMgrAdd(model *domain.Model, resMedalId uin
}
}
func
GetGroupMedalOrErr
(
model
*
domain
.
Model
,
id
mysql
.
ID
)
(
*
GroupMedal
,
error
)
{
groupMedal
:=
GroupMedal
{}
if
err
:=
model
.
Db
.
Model
(
&
GroupMedal
{})
.
First
(
&
groupMedal
,
id
)
.
Error
;
err
!=
nil
{
...
...
@@ -65,7 +66,9 @@ func BatchGetMedals(db *gorm.DB, groupIds []string) (map[string][]uint64, error)
return
nil
,
nil
}
rows
:=
make
([]
GroupMedal
,
0
)
if
err
:=
db
.
Model
(
&
GroupMedal
{})
.
Where
(
"im_group_id IN ?"
,
groupIds
)
.
Find
(
&
rows
)
.
Error
;
err
!=
nil
{
if
err
:=
db
.
Model
(
&
GroupMedal
{})
.
Where
(
"im_group_id IN ?"
,
groupIds
)
.
Where
(
"(expire_at is null or expire_at > ?)"
,
time
.
Now
()
.
Format
(
utils
.
DATETIME_FORMAT
))
.
Find
(
&
rows
)
.
Error
;
err
!=
nil
{
return
nil
,
err
}
result
:=
make
(
map
[
string
][]
uint64
,
0
)
...
...
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