Skip to content

Commit 6bcb1ef

Browse files
committed
fix(db): formatting date in stats requests
1 parent 350be30 commit 6bcb1ef

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

db/sql/SqlDb.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -893,11 +893,11 @@ func (d *SqlDb) GetTaskStats(projectID int, templateID *int, unit db.TaskStatUni
893893
Count int `db:"count"`
894894
}
895895

896-
q := squirrel.Select("DATE(created) AS date, status, COUNT(*) AS count").
896+
q := squirrel.Select("DATE(SUBSTR(created, 1, 25)) AS date, status, COUNT(*) AS count").
897897
From("task").
898898
Where("project_id=?", projectID).
899-
GroupBy("DATE(created), status").
900-
OrderBy("DATE(created) DESC")
899+
GroupBy("date, status").
900+
OrderBy("date DESC")
901901

902902
if templateID != nil {
903903
q = q.Where("template_id=?", *templateID)

0 commit comments

Comments
 (0)