From 085d3ddb73cfdc4845ca7a75c7c858c769d1bd4c Mon Sep 17 00:00:00 2001 From: ziming Date: Tue, 12 Aug 2025 11:39:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E7=AC=94=E7=AB=8B=E5=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/data/repoimpl/order.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/data/repoimpl/order.go b/internal/data/repoimpl/order.go index a592b7f..444da78 100644 --- a/internal/data/repoimpl/order.go +++ b/internal/data/repoimpl/order.go @@ -72,7 +72,7 @@ func (p *OrderRepoImpl) SpecifyFindInBatches(ctx context.Context, req *bo.FindIn func (p *OrderRepoImpl) FinSucByStockIdInBatches(ctx context.Context, req *do.WechatQuery, fun func(ctx context.Context, rows []*bo.OrderBo) error) error { tx := p.DB(ctx). - Where("status = ?", vo.OrderStatusSuccess.GetValue()). + Where("`status` = ?", vo.OrderStatusSuccess.GetValue()). Where("activity_id = ''") if req.ProductNo != "" { @@ -111,7 +111,7 @@ func (p *OrderRepoImpl) FinFailByStockIdInBatches(ctx context.Context, batchNo s result := p.DB(ctx). Where("batch_no = ?", batchNo). - Where("status = ?", vo.OrderStatusFail.GetValue()). + Where("`status` = ?", vo.OrderStatusFail.GetValue()). FindInBatches(&results, 100, func(tx *gorm.DB, batch int) error { return fun(ctx, p.ToBos(results)) }) @@ -128,7 +128,7 @@ func (p *OrderRepoImpl) FindIngInBatches(ctx context.Context, fun func(ctx conte var results = make([]*model.Order, 0) result := p.DB(ctx). - Where("status = ?", vo.OrderStatusIng.GetValue()). + Where("`status` = ?", vo.OrderStatusIng.GetValue()). Limit(20). FindInBatches(&results, 10, func(tx *gorm.DB, batch int) error { return fun(ctx, p.ToBos(results)) @@ -147,7 +147,7 @@ func (p *OrderRepoImpl) FindInBatches(ctx context.Context, req *bo.FindInBatches result := p.DB(ctx). Where("activity_id = ''"). - Where("status IN (?)", []uint8{vo.OrderStatusSuccess.GetValue(), vo.OrderStatusUse.GetValue()}). + Where("`status` IN (?)", []uint8{vo.OrderStatusSuccess.GetValue(), vo.OrderStatusUse.GetValue()}). Where("receive_success_time BETWEEN ? AND ?", req.StartTime, req.EndTime). FindInBatches(&results, 100, func(tx *gorm.DB, batch int) error { // tx.RowsAffected 提供当前批处理中记录的计数(the count of records in the current batch)