From 3e0f88cc85ca21a20c6377669896c5287568c93f Mon Sep 17 00:00:00 2001 From: ferdiansyah783 Date: Sat, 31 Aug 2024 13:50:43 +0700 Subject: [PATCH] fix update history order --- internal/repository/orders/order.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/repository/orders/order.go b/internal/repository/orders/order.go index b3d93fd..cd6f8ec 100644 --- a/internal/repository/orders/order.go +++ b/internal/repository/orders/order.go @@ -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) }