shenjiachi před 5 dny
rodič
revize
6bf3ba96c5
2 změnil soubory, kde provedl 11 přidání a 0 odebrání
  1. +1
    -0
      src/dao/fin_withdraw_apply_dao.go
  2. +10
    -0
      src/implement/fin_withdraw_apply_implement.go

+ 1
- 0
src/dao/fin_withdraw_apply_dao.go Zobrazit soubor

@@ -8,4 +8,5 @@ import (
type FinWithdrawApplyDao interface {
FinWithdrawApplyGetBySession(session *xorm.Session, startAt, endAt string, params map[string]interface{}) (*[]model.FinWithdrawApply, error)
FinWithdrawApplyInsertOneBySession(session *xorm.Session, m *model.FinWithdrawApply) (int64, error)
FinWithdrawApplyAmountGetByParams(params map[string]interface{}) (float64, error)
}

+ 10
- 0
src/implement/fin_withdraw_apply_implement.go Zobrazit soubor

@@ -44,3 +44,13 @@ func (f FinWithdrawApplyDb) FinWithdrawApplyGetBySession(session *xorm.Session,

return m, nil
}

func (f FinWithdrawApplyDb) FinWithdrawApplyAmountGetByParams(params map[string]interface{}) (float64, error) {
var m model.FinWithdrawApply
var query = fmt.Sprintf("%s =?", params["key"])
total, err := f.Db.Where(query, params["value"]).Sum(m, "amount")
if err != nil {
return 0, err
}
return total, nil
}

Načítá se…
Zrušit
Uložit