order by
This commit is contained in:
parent
5a3fefdd19
commit
482e8d7f82
|
|
@ -149,7 +149,8 @@ func (p *OrderRepoImpl) FindInBatches(ctx context.Context, req *bo.FindInBatches
|
||||||
Where("activity_id = ''").
|
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).
|
Where("receive_success_time BETWEEN ? AND ?", req.StartTime, req.EndTime).
|
||||||
FindInBatches(&results, 100, func(tx *gorm.DB, batch int) error {
|
Order(""). // 显式清除排序,移除默认的 ORDER BY
|
||||||
|
FindInBatches(&results, 1000, func(tx *gorm.DB, batch int) error {
|
||||||
// tx.RowsAffected 提供当前批处理中记录的计数(the count of records in the current batch)
|
// tx.RowsAffected 提供当前批处理中记录的计数(the count of records in the current batch)
|
||||||
// 'batch' 变量表示当前批号(the current batch number)
|
// 'batch' 变量表示当前批号(the current batch number)
|
||||||
// 返回 error 将阻止更多的批处理
|
// 返回 error 将阻止更多的批处理
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue