fix update history order

This commit is contained in:
ferdiansyah783 2024-08-31 13:50:43 +07:00
parent 4e84e6ea84
commit 3e0f88cc85

View File

@ -171,7 +171,7 @@ func (b *OrderRepository) GetAllHystoryOrders(ctx context.Context, req entity.Or
} else {
currentTime := time.Now()
startOfMonth := time.Date(currentTime.Year(), currentTime.Month(), 1, 0, 0, 0, 0, time.Local)
endOfMonth := startOfMonth.AddDate(0, 1, -1)
endOfMonth := startOfMonth.AddDate(0, 1, 0).Add(-time.Second)
query = query.Where("orders.created_at BETWEEN ? AND ?", startOfMonth, endOfMonth)
}