Skip to content

Commit

Permalink
fixed db payment history
Browse files Browse the repository at this point in the history
  • Loading branch information
elraphty committed Feb 21, 2024
1 parent 6e8f81b commit a0d33ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a0d33ed

Please sign in to comment.