From 1d8862ab7bddb43dae8accf5d5919a1af98065d7 Mon Sep 17 00:00:00 2001 From: ziming Date: Thu, 12 Jun 2025 11:04:07 +0800 Subject: [PATCH] timeSliceQueryPush --- internal/biz/cron_notice.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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)