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
a4a24136
Commit
a4a24136
authored
Jun 07, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update anniversary.go
parent
831fb5a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
anniversary.go
domain/model/cp_m/anniversary.go
+4
-1
No files found.
domain/model/cp_m/anniversary.go
View file @
a4a24136
...
...
@@ -3,6 +3,7 @@ package cp_m
import
(
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/resource/mysql"
"hilo-user/_const/enum/cp_e"
"time"
)
...
...
@@ -10,12 +11,14 @@ import (
type
CpAnniversary
struct
{
mysql
.
Entity
CpId
mysql
.
ID
Type
cp_e
.
AnniversaryItemType
UserId1
mysql
.
ID
UserId2
mysql
.
ID
Content
string
Timestamp
int64
IsRemind
bool
Reminded
mysql
.
YesNo
Sort
int
}
// 添加cp纪念日
...
...
@@ -52,7 +55,7 @@ func GetAllCpAnniversary(model *domain.Model, userId mysql.ID) []CpAnniversary {
if
!
exists
{
return
res
}
if
err
:=
model
.
DB
()
.
Model
(
CpAnniversary
{})
.
Where
(
"cp_id = ?"
,
relation
.
ID
)
.
Order
(
"`
timestamp` DESC,id
DESC"
)
.
Find
(
&
res
)
.
Error
;
err
!=
nil
{
if
err
:=
model
.
DB
()
.
Model
(
CpAnniversary
{})
.
Where
(
"cp_id = ?"
,
relation
.
ID
)
.
Order
(
"`
sort` DESC,updated_time
DESC"
)
.
Find
(
&
res
)
.
Error
;
err
!=
nil
{
model
.
Log
.
Errorf
(
"GetAllCpAnniversary fail:%v"
,
err
)
}
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