diff --git a/internal/biz/cron_notice.go b/internal/biz/cron_notice.go index cb99d9f..224c397 100644 --- a/internal/biz/cron_notice.go +++ b/internal/biz/cron_notice.go @@ -21,13 +21,14 @@ func (v *VoucherBiz) Notice(ctx context.Context) error { now := time.Now() - // 获取七天前的日期 + // 获取 NoticeStartDays 天前的日期 noticeStartDay := now.AddDate(0, 0, int(-v.bc.Cmb.NoticeStartDays)) - // 获取七天前 00:00:00 的时间 + // 获取 NoticeStartDays 天前 00:00:00 的时间 startTime := time.Date(noticeStartDay.Year(), noticeStartDay.Month(), noticeStartDay.Day(), 0, 0, 0, 0, noticeStartDay.Location()) + // 获取 NoticeEndDays 天前的日期 noticeEndDay := now.AddDate(0, 0, int(-v.bc.Cmb.NoticeEndDays)) - // 获取昨天 23:59:59 的时间 + // 获取 NoticeEndDays 天 23:59:59 的时间 endTime := time.Date(noticeEndDay.Year(), noticeEndDay.Month(), noticeEndDay.Day(), 23, 59, 59, 0, noticeEndDay.Location()) return v.timeSliceQuery(ctx, startTime, endTime)