From 9abf241a3c51a6d70c762b4b81d8acd8017d3286 Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 31 Jan 2023 21:13:33 -0500 Subject: [PATCH] Fix a broken query --- endpoints/analytics.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/endpoints/analytics.go b/endpoints/analytics.go index 140a4e0..2ef3af6 100644 --- a/endpoints/analytics.go +++ b/endpoints/analytics.go @@ -35,10 +35,9 @@ func NearlyCompleteFunds(w http.ResponseWriter, r *http.Request) { } var resp NearlyCompleteFundsResponse - Db.Table("contributions"). - Select("rf.id", "asset", "min_contribution", "amount_available", "memo", "fund_wallet", "sum(amount) as raised"). - Joins("inner join reward_funds rf on rf.id = contributions.reward_fund_id"). - Where("rf.amount_available < ?", req.Threshold). + Db.Table("reward_funds"). + Select("id", "asset", "min_contribution", "amount_available", "memo", "fund_wallet"). + Where("amount_available < ?", req.Threshold). Scan(&resp.Funds) err = json.NewEncoder(w).Encode(resp) if err != nil {