Browse Source

update

master
shenjiachi 5 days ago
parent
commit
6bf3ba96c5
2 changed files with 11 additions and 0 deletions
  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 View File

@@ -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 View File

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

Loading…
Cancel
Save