Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskcenter
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
Odysseus
taskcenter
Commits
57ee0024
Commit
57ee0024
authored
Sep 05, 2024
by
贾浩@五瓣科技
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update todo status
parent
39f2816d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
constant.go
constant/constant.go
+1
-1
db.go
dao/db.go
+2
-2
No files found.
constant/constant.go
View file @
57ee0024
...
@@ -76,5 +76,5 @@ const (
...
@@ -76,5 +76,5 @@ const (
TaskHistoryStatusSuccess
=
"success"
// 3分钟后检查成功
TaskHistoryStatusSuccess
=
"success"
// 3分钟后检查成功
TaskHistoryStatusRetry
=
"retry"
// 3分钟后检查未完成
TaskHistoryStatusRetry
=
"retry"
// 3分钟后检查未完成
TaskHistoryStatusUncompleted
=
"uncompleted"
TaskHistoryStatusUncompleted
=
"uncompleted"
TaskHistoryStatus
NotExist
=
"not exist
"
TaskHistoryStatus
Todo
=
"todo
"
)
)
dao/db.go
View file @
57ee0024
...
@@ -133,7 +133,7 @@ func (d *Dao) GetTaskResult(tid int, userId string) (status string, err error) {
...
@@ -133,7 +133,7 @@ func (d *Dao) GetTaskResult(tid int, userId string) (status string, err error) {
if
!
isDailyTask
{
if
!
isDailyTask
{
err
=
d
.
db
.
Model
(
&
dbModel
.
TaskHistory
{})
.
Where
(
"task_id = ? and user_id = ?"
,
tid
,
userId
)
.
First
(
temp
)
.
Error
err
=
d
.
db
.
Model
(
&
dbModel
.
TaskHistory
{})
.
Where
(
"task_id = ? and user_id = ?"
,
tid
,
userId
)
.
First
(
temp
)
.
Error
if
err
==
gorm
.
ErrRecordNotFound
{
if
err
==
gorm
.
ErrRecordNotFound
{
return
constant
.
TaskHistoryStatus
NotExist
,
nil
return
constant
.
TaskHistoryStatus
Todo
,
nil
}
}
return
temp
.
Status
,
err
return
temp
.
Status
,
err
}
}
...
@@ -142,7 +142,7 @@ func (d *Dao) GetTaskResult(tid int, userId string) (status string, err error) {
...
@@ -142,7 +142,7 @@ func (d *Dao) GetTaskResult(tid int, userId string) (status string, err error) {
Where
(
"task_id = ? and user_id = ? and created_at >= ?"
,
tid
,
userId
,
time
.
Now
()
.
UTC
()
.
Truncate
(
24
*
time
.
Hour
))
.
Where
(
"task_id = ? and user_id = ? and created_at >= ?"
,
tid
,
userId
,
time
.
Now
()
.
UTC
()
.
Truncate
(
24
*
time
.
Hour
))
.
First
(
temp
)
.
Error
First
(
temp
)
.
Error
if
err
==
gorm
.
ErrRecordNotFound
{
if
err
==
gorm
.
ErrRecordNotFound
{
return
constant
.
TaskHistoryStatus
NotExist
,
nil
return
constant
.
TaskHistoryStatus
Todo
,
nil
}
}
return
temp
.
Status
,
err
return
temp
.
Status
,
err
}
}
...
...
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