diff --git a/internal/biz/cron_notice.go b/internal/biz/cron_notice.go index ab2d3aa..62a1bba 100644 --- a/internal/biz/cron_notice.go +++ b/internal/biz/cron_notice.go @@ -26,13 +26,13 @@ func (v *VoucherBiz) ExecuteNotice(ctx context.Context) error { now := time.Now() // 获取七天前的日期 - sevenDaysAgo := now.AddDate(0, 0, int(-v.bc.Cmb.NoticeStartDays)) + noticeStartDay := now.AddDate(0, 0, int(-v.bc.Cmb.NoticeStartDays)) // 获取七天前 00:00:00 的时间 - startTime := time.Date(sevenDaysAgo.Year(), sevenDaysAgo.Month(), sevenDaysAgo.Day(), 0, 0, 0, 0, sevenDaysAgo.Location()) + startTime := time.Date(noticeStartDay.Year(), noticeStartDay.Month(), noticeStartDay.Day(), 0, 0, 0, 0, noticeStartDay.Location()) - sevenDaysAgoEnd := now.AddDate(0, 0, int(-v.bc.Cmb.NoticeEndDays)) + noticeEndDay := now.AddDate(0, 0, int(-v.bc.Cmb.NoticeEndDays)) // 获取昨天 23:59:59 的时间 - endTime := time.Date(sevenDaysAgoEnd.Year(), sevenDaysAgoEnd.Month(), sevenDaysAgoEnd.Day(), 23, 59, 59, 0, sevenDaysAgoEnd.Location()) + endTime := time.Date(noticeEndDay.Year(), noticeEndDay.Month(), noticeEndDay.Day(), 23, 59, 59, 0, noticeEndDay.Location()) req := &bo.FindInBatchesUseBo{ Type: vo.OrderTypeCmb,