|
- package svc
-
- import (
- "applet/app/md"
- "applet/app/utils"
- db "code.fnuoos.com/zhimeng/model.git/src"
- "code.fnuoos.com/zhimeng/model.git/src/super/implement"
- "github.com/gin-gonic/gin"
- )
-
- func FinancialDynamicsMediumList(c *gin.Context, req md.FinancialDynamicsMediumListReq) md.FinancialDynamicsMediumListRes {
- engine := db.Db
- NewMediumFinancialDynamicsDb := implement.NewMediumFinancialDynamicsDb(engine)
- list, total, _ := NewMediumFinancialDynamicsDb.FindMediumFinancialDynamics(c.GetString("mid"), req.Uid, req.StartTime, req.EndTime, utils.StrToInt(req.Page), utils.StrToInt(req.Limit))
- data := make([]md.FinancialDynamicsMediumListData, 0)
- if len(list) > 0 {
- for _, v := range list {
- var tmp = md.FinancialDynamicsMediumListData{
- Id: utils.IntToStr(v.Id),
- PayTime: v.PayTime,
- Amount: v.Amount,
- PayMethod: utils.IntToStr(v.PayMethod),
- Certificate: v.Certificate,
- Memo: v.Memo,
- BusinessKind: utils.IntToStr(v.BusinessKind),
- }
- medium := GetMediumInfo(c, v.MediumId)
- if medium != nil {
- tmp.Name = medium["name"]
- }
- data = append(data, tmp)
- }
- }
- res := md.FinancialDynamicsMediumListRes{
- List: data,
- Total: total,
- BusinessKind: md.BusinessKind,
- }
- return res
- }
- func FinancialDynamicsMediumTotal(c *gin.Context, req md.FinancialDynamicsMediumTotalReq) md.FinancialDynamicsMediumTotalRes {
- //engine := db.Db
- //sql:=`select sum(amount) `
- res := md.FinancialDynamicsMediumTotalRes{
- BalanceAmount: "",
- AllAmount: "",
- UseAmount: "",
- PayCount: "",
- }
- return res
- }
|