소스 검색

Fix estimate_results SQL error

master
Immanuel Onyeka 1 년 전
부모
커밋
a2b2ca2ca2
3개의 변경된 파일12개의 추가작업 그리고 8개의 파일을 삭제
  1. +1
    -1
      assets/main.css
  2. +3
    -2
      components/estimates.vue
  3. +8
    -5
      skouter.go

+ 1
- 1
assets/main.css 파일 보기

@@ -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 파일 보기

@@ -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"> <div class="entry" v-for="e in estimates" v-if="!estimate"
<span @click="() => estimate = e"> @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 파일 보기

@@ -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, cash_to_close
FROM estimate_result WHERE id = CASE @e := ? WHEN 0 THEN id ELSE @e END AND FROM estimate_result r
loan_id = ( SELECT id FROM loan WHERE loan.estimate_id = ? ) 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)




||||||
x
 
000:0
불러오는 중...
취소
저장