fix(quota): update time handling in quota logic and correct subscriber ID query
This commit is contained in:
@@ -37,12 +37,12 @@ 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.UnixMilli(req.StartTime)
|
||||
start := time.Unix(req.StartTime, 0)
|
||||
tx = tx.Where("`start_time` >= ?", start)
|
||||
}
|
||||
if req.EndTime != 0 {
|
||||
end := time.UnixMilli(req.EndTime)
|
||||
tx = tx.Where("`start_time` <= ?", end)
|
||||
tx = tx.Where("`expire_time` <= ?", end)
|
||||
}
|
||||
if err = tx.Count(&count).Error; err != nil {
|
||||
l.Errorf("[QueryQuotaTaskPreCount] count error: %v", err.Error())
|
||||
|
||||
Reference in New Issue
Block a user