Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-user
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
chenweijian
hilo-user
Commits
8d27979c
Commit
8d27979c
authored
Jun 16, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:两边的nick
parent
78403c9e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
anniversary.go
domain/model/cp_m/anniversary.go
+11
-0
No files found.
domain/model/cp_m/anniversary.go
View file @
8d27979c
...
@@ -108,9 +108,20 @@ func GetAllCpAnniversary(model *domain.Model, userId mysql.ID, lang string) []Cp
...
@@ -108,9 +108,20 @@ func GetAllCpAnniversary(model *domain.Model, userId mysql.ID, lang string) []Cp
if
err
:=
model
.
DB
()
.
Model
(
CpAnniversary
{})
.
Where
(
"cp_id = ?"
,
relation
.
Id
)
.
Order
(
"`sort` DESC,updated_time DESC,id ASC"
)
.
Find
(
&
res
)
.
Error
;
err
!=
nil
{
if
err
:=
model
.
DB
()
.
Model
(
CpAnniversary
{})
.
Where
(
"cp_id = ?"
,
relation
.
Id
)
.
Order
(
"`sort` DESC,updated_time DESC,id ASC"
)
.
Find
(
&
res
)
.
Error
;
err
!=
nil
{
model
.
Log
.
Errorf
(
"GetAllCpAnniversary fail:%v"
,
err
)
model
.
Log
.
Errorf
(
"GetAllCpAnniversary fail:%v"
,
err
)
}
}
var
userIds
=
[]
mysql
.
ID
{
relation
.
UserId1
,
relation
.
UserId2
}
users
,
_
:=
user_m
.
GetUserMapByIds
(
model
,
userIds
)
n
:=
0
for
i
,
v
:=
range
res
{
for
i
,
v
:=
range
res
{
if
v
.
CreatedTime
.
Equal
(
v
.
UpdatedTime
)
&&
v
.
MsgId
>
0
{
if
v
.
CreatedTime
.
Equal
(
v
.
UpdatedTime
)
&&
v
.
MsgId
>
0
{
res
[
i
]
.
Content
=
GetTranslate
(
v
.
MsgId
,
lang
)
res
[
i
]
.
Content
=
GetTranslate
(
v
.
MsgId
,
lang
)
if
v
.
MsgId
==
260
{
n
++
if
n
==
1
{
res
[
i
]
.
Content
=
fmt
.
Sprintf
(
GetTranslate
(
v
.
MsgId
,
lang
),
users
[
relation
.
UserId1
]
.
Nick
)
}
else
{
res
[
i
]
.
Content
=
fmt
.
Sprintf
(
GetTranslate
(
v
.
MsgId
,
lang
),
users
[
relation
.
UserId2
]
.
Nick
)
}
}
}
}
}
}
return
res
return
res
...
...
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