修复提取并发问题 & 修复接口时区问题
This commit is contained in:
@@ -282,22 +282,28 @@ func couponUserPageConditions(req CouponUserPageFilter) []gen.Condition {
|
||||
}
|
||||
}
|
||||
if req.CreatedAtStart != nil {
|
||||
conds = append(conds, q.CouponUser.CreatedAt.Gte(u.DateHead(*req.CreatedAtStart)))
|
||||
start := u.DateHead(*req.CreatedAtStart)
|
||||
conds = append(conds, q.CouponUser.CreatedAt.Gte(start))
|
||||
}
|
||||
if req.CreatedAtEnd != nil {
|
||||
conds = append(conds, q.CouponUser.CreatedAt.Lte(u.DateTail(*req.CreatedAtEnd)))
|
||||
end := u.DateTail(*req.CreatedAtEnd)
|
||||
conds = append(conds, q.CouponUser.CreatedAt.Lte(end))
|
||||
}
|
||||
if req.ExpireAtStart != nil {
|
||||
conds = append(conds, q.CouponUser.ExpireAt.Gte(u.DateHead(*req.ExpireAtStart)))
|
||||
start := u.DateHead(*req.ExpireAtStart)
|
||||
conds = append(conds, q.CouponUser.ExpireAt.Gte(start))
|
||||
}
|
||||
if req.ExpireAtEnd != nil {
|
||||
conds = append(conds, q.CouponUser.ExpireAt.Lte(u.DateTail(*req.ExpireAtEnd)))
|
||||
end := u.DateTail(*req.ExpireAtEnd)
|
||||
conds = append(conds, q.CouponUser.ExpireAt.Lte(end))
|
||||
}
|
||||
if req.UsedAtStart != nil {
|
||||
conds = append(conds, q.CouponUser.UsedAt.Gte(u.DateHead(*req.UsedAtStart)))
|
||||
start := u.DateHead(*req.UsedAtStart)
|
||||
conds = append(conds, q.CouponUser.UsedAt.Gte(start))
|
||||
}
|
||||
if req.UsedAtEnd != nil {
|
||||
conds = append(conds, q.CouponUser.UsedAt.Lte(u.DateTail(*req.UsedAtEnd)))
|
||||
end := u.DateTail(*req.UsedAtEnd)
|
||||
conds = append(conds, q.CouponUser.UsedAt.Lte(end))
|
||||
}
|
||||
return conds
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user