From a0d33ed2d9a0ee3c0b6a560375be129b14c4b0a4 Mon Sep 17 00:00:00 2001 From: elraphty Date: Wed, 21 Feb 2024 21:59:50 +0100 Subject: [PATCH] fixed db payment history --- db/db.go | 2 +- utils/utils.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db/db.go b/db/db.go index 1f6c50d0e..bfa82960a 100644 --- a/db/db.go +++ b/db/db.go @@ -1814,7 +1814,7 @@ func (db database) GetPaymentHistory(org_uuid string, r *http.Request) []Payment limitQuery = fmt.Sprintf("LIMIT %d OFFSET %d", limit, offset) - query := `SELECT * FROM payment_histories WHERE org_uuid = '` + org_uuid + `' ORDER BY created DESC` + query := `SELECT * FROM payment_histories WHERE org_uuid = '` + org_uuid + `' AND status = true ORDER BY created DESC` db.db.Raw(query + " " + limitQuery).Find(&payment) return payment diff --git a/utils/utils.go b/utils/utils.go index 629b683bc..95f41417a 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -28,7 +28,7 @@ func GetPaginationParams(r *http.Request) (int, int, string, string, string) { intPage = 1 } if intLimit == 0 { - intLimit = -1 + intLimit = 1 } if sortBy == "" { sortBy = "created"