From 418ab72562815ade91f4a4e769c476a1e2a3a922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AD=90=E9=93=AD?= Date: Mon, 17 Mar 2025 16:08:33 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E6=9F=A5=E8=AF=A2=E6=A3=80?= =?UTF-8?q?=E7=B4=A2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/biz/order_notice.go | 2 ++ internal/data/repoimpl/order.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/biz/order_notice.go b/internal/biz/order_notice.go index 3b23f41..e7b3956 100644 --- a/internal/biz/order_notice.go +++ b/internal/biz/order_notice.go @@ -54,6 +54,8 @@ func (v *VoucherBiz) ExecuteNotice(ctx context.Context) error { } + time.Sleep(1 * time.Second) + return nil }) diff --git a/internal/data/repoimpl/order.go b/internal/data/repoimpl/order.go index 5008c73..009bf47 100644 --- a/internal/data/repoimpl/order.go +++ b/internal/data/repoimpl/order.go @@ -33,9 +33,9 @@ func (p *OrderRepoImpl) FindInBatches(ctx context.Context, w *bo.FindInBatchesUs var results = make([]*model.Order, 0) result := p.db.DB(ctx). - Where("receive_success_time BETWEEN ? AND ?", w.StartTime, w.EndTime). Where("type = ?", w.Type). Where("status IN (?)", []uint8{vo.OrderStatusSuccess.GetValue(), vo.OrderStatusUse.GetValue()}). + Where("receive_success_time BETWEEN ? AND ?", w.StartTime, w.EndTime). FindInBatches(&results, 100, func(tx *gorm.DB, batch int) error { // tx.RowsAffected 提供当前批处理中记录的计数(the count of records in the current batch) // 'batch' 变量表示当前批号(the current batch number)