Pārlūkot izejas kodu

Fix estimate_results SQL error

master
Immanuel Onyeka pirms 1 gada
vecāks
revīzija
a2b2ca2ca2
3 mainītis faili ar 12 papildinājumiem un 8 dzēšanām
  1. +1
    -1
      assets/main.css
  2. +3
    -2
      components/estimates.vue
  3. +8
    -5
      skouter.go

+ 1
- 1
assets/main.css Parādīt failu

@@ -387,7 +387,7 @@ section.mi .row input[type=checkbox] {


section.estimates .entry { section.estimates .entry {
padding: 10px 3px; padding: 10px 3px;
border: 2px solid var(--outline);
border-bottom: 2px solid var(--outline);
border-radius: 3px; border-radius: 3px;
} }




+ 3
- 2
components/estimates.vue Parādīt failu

@@ -32,8 +32,9 @@
<section class="inputs estimates"> <section class="inputs estimates">
<h3>Saved Estimates</h3> <h3>Saved Estimates</h3>


<div class="entry" v-for="e in estimates" v-if="!estimate">
<span @click="() => estimate = e">
<div class="entry" v-for="e in estimates" v-if="!estimate"
@click="() => estimate = e">
<span>
{{e.id}} - {{e.property}} - ${{(e.price/100).toLocaleString()}} {{e.id}} - {{e.property}} - ${{(e.price/100).toLocaleString()}}
</span> </span>
</div> </div>


+ 8
- 5
skouter.go Parādīt failu

@@ -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)




Notiek ielāde…
Atcelt
Saglabāt