瀏覽代碼

update

master
shenjiachi 5 天之前
父節點
當前提交
6bf3ba96c5
共有 2 個檔案被更改,包括 11 行新增0 行删除
  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 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存