|
@@ -96,7 +96,7 @@ type Loan struct { |
|
|
Dti float32 `json:"dti"` |
|
|
Dti float32 `json:"dti"` |
|
|
Hoi int `json:"hoi"` |
|
|
Hoi int `json:"hoi"` |
|
|
Hazard int `json:"hazard"` |
|
|
Hazard int `json:"hazard"` |
|
|
Tax int `json:"hoi"` |
|
|
|
|
|
|
|
|
Tax int `json:"tax"` |
|
|
Interest float32 `json:"interest"` |
|
|
Interest float32 `json:"interest"` |
|
|
Mi MI `json:"mi"` |
|
|
Mi MI `json:"mi"` |
|
|
Fees []Fee `json:"fees"` |
|
|
Fees []Fee `json:"fees"` |
|
@@ -915,15 +915,18 @@ func getResults(db *sql.DB, e int, id int) ( []Result, error ) { |
|
|
var err error |
|
|
var err error |
|
|
|
|
|
|
|
|
query = `SELECT |
|
|
query = `SELECT |
|
|
id, |
|
|
|
|
|
|
|
|
r.id, |
|
|
loan_id, |
|
|
loan_id, |
|
|
loan_payment, |
|
|
loan_payment, |
|
|
total_monthly, |
|
|
total_monthly, |
|
|
total_fees, |
|
|
total_fees, |
|
|
total_credits, |
|
|
total_credits, |
|
|
cash_to_close, |
|
|
|
|
|
FROM estimate_result WHERE id = CASE @e := ? WHEN 0 THEN id ELSE @e END AND |
|
|
|
|
|
loan_id = ( SELECT id FROM loan WHERE loan.estimate_id = ? ) |
|
|
|
|
|
|
|
|
cash_to_close |
|
|
|
|
|
FROM estimate_result r |
|
|
|
|
|
INNER JOIN loan |
|
|
|
|
|
ON r.loan_id = loan.id |
|
|
|
|
|
WHERE r.id = CASE @e := ? WHEN 0 THEN r.id ELSE @e END |
|
|
|
|
|
AND loan.estimate_id = ? |
|
|
` |
|
|
` |
|
|
rows, err = db.Query(query, id, e) |
|
|
rows, err = db.Query(query, id, e) |
|
|
|
|
|
|
|
|