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)