From c1c913cb00b7ee65d166c333eae3c8e47d39af35 Mon Sep 17 00:00:00 2001 From: Chang lue Tsen Date: Sat, 13 Sep 2025 14:12:33 -0400 Subject: [PATCH] fix(quota): update time handling to use UnixMilli for start time in quota logic --- internal/logic/admin/marketing/createQuotaTaskLogic.go | 2 +- internal/logic/admin/marketing/queryQuotaTaskPreCountLogic.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/logic/admin/marketing/createQuotaTaskLogic.go b/internal/logic/admin/marketing/createQuotaTaskLogic.go index b08abbd..99d9778 100644 --- a/internal/logic/admin/marketing/createQuotaTaskLogic.go +++ b/internal/logic/admin/marketing/createQuotaTaskLogic.go @@ -42,7 +42,7 @@ func (l *CreateQuotaTaskLogic) CreateQuotaTask(req *types.CreateQuotaTaskRequest query = query.Where("`status` IN ?", []int64{0, 1, 2}) // 0: Pending 1: Active 2: Finished } if req.StartTime != 0 { - start := time.Unix(req.StartTime, 0) + start := time.UnixMilli(req.StartTime) query = query.Where("`start_time` >= ?", start) } if req.EndTime != 0 { diff --git a/internal/logic/admin/marketing/queryQuotaTaskPreCountLogic.go b/internal/logic/admin/marketing/queryQuotaTaskPreCountLogic.go index 2b77ada..dde1b8e 100644 --- a/internal/logic/admin/marketing/queryQuotaTaskPreCountLogic.go +++ b/internal/logic/admin/marketing/queryQuotaTaskPreCountLogic.go @@ -37,7 +37,7 @@ func (l *QueryQuotaTaskPreCountLogic) QueryQuotaTaskPreCount(req *types.QueryQuo tx = tx.Where("`status` IN ?", []int64{0, 1, 2}) // 0: Pending 1: Active 2: Finished } if req.StartTime != 0 { - start := time.Unix(req.StartTime, 0) + start := time.UnixMilli(req.StartTime) tx = tx.Where("`start_time` >= ?", start) } if req.EndTime != 0 {