广告平台(站长使用)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

svc_financial_dynamics.go 1.6 KiB

2 months ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package svc
  2. import (
  3. "applet/app/md"
  4. "applet/app/utils"
  5. db "code.fnuoos.com/zhimeng/model.git/src"
  6. "code.fnuoos.com/zhimeng/model.git/src/super/implement"
  7. "github.com/gin-gonic/gin"
  8. )
  9. func FinancialDynamicsMediumList(c *gin.Context, req md.FinancialDynamicsMediumListReq) md.FinancialDynamicsMediumListRes {
  10. engine := db.Db
  11. NewMediumFinancialDynamicsDb := implement.NewMediumFinancialDynamicsDb(engine)
  12. list, total, _ := NewMediumFinancialDynamicsDb.FindMediumFinancialDynamics(c.GetString("mid"), req.Uid, req.StartTime, req.EndTime, utils.StrToInt(req.Page), utils.StrToInt(req.Limit))
  13. data := make([]md.FinancialDynamicsMediumListData, 0)
  14. if len(list) > 0 {
  15. for _, v := range list {
  16. var tmp = md.FinancialDynamicsMediumListData{
  17. Id: utils.IntToStr(v.Id),
  18. PayTime: v.PayTime,
  19. Amount: v.Amount,
  20. PayMethod: utils.IntToStr(v.PayMethod),
  21. Certificate: v.Certificate,
  22. Memo: v.Memo,
  23. BusinessKind: utils.IntToStr(v.BusinessKind),
  24. }
  25. medium := GetMediumInfo(c, v.MediumId)
  26. if medium != nil {
  27. tmp.Name = medium["name"]
  28. }
  29. data = append(data, tmp)
  30. }
  31. }
  32. res := md.FinancialDynamicsMediumListRes{
  33. List: data,
  34. Total: total,
  35. BusinessKind: md.BusinessKind,
  36. }
  37. return res
  38. }
  39. func FinancialDynamicsMediumTotal(c *gin.Context, req md.FinancialDynamicsMediumTotalReq) md.FinancialDynamicsMediumTotalRes {
  40. //engine := db.Db
  41. //sql:=`select sum(amount) `
  42. res := md.FinancialDynamicsMediumTotalRes{
  43. BalanceAmount: "",
  44. AllAmount: "",
  45. UseAmount: "",
  46. PayCount: "",
  47. }
  48. return res
  49. }