|
@@ -35,10 +35,9 @@ func NearlyCompleteFunds(w http.ResponseWriter, r *http.Request) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var resp NearlyCompleteFundsResponse |
|
|
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) |
|
|
Scan(&resp.Funds) |
|
|
err = json.NewEncoder(w).Encode(resp) |
|
|
err = json.NewEncoder(w).Encode(resp) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|