vo.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package statisticsrv
  2. import (
  3. "Cold_Logistic/internal/server/infra/models"
  4. "gogs.baozhida.cn/Cold_Logistic_libs/pkg/contrib/core"
  5. "time"
  6. )
  7. type OrderNumTimeStatReqVO struct {
  8. StatType models.TimeStatType `json:"statType"` // 年,月,天
  9. TimeStart models.MyTime `json:"timeStart"`
  10. TimeEnd models.MyTime `json:"timeEnd"`
  11. OrderStatus int `json:"orderStatus"`
  12. }
  13. func (r *OrderNumTimeStatReqVO) Init() {
  14. if r.StatType == "" {
  15. r.StatType = models.TimeStatDay
  16. }
  17. if r.TimeStart.IsZero() {
  18. r.TimeStart = models.NewMyTime(time.Now()).GetYearFirstDay()
  19. }
  20. if r.TimeEnd.IsZero() {
  21. r.TimeEnd = models.NewMyTime(time.Now())
  22. }
  23. //if r.TimeEnd.Sub(r.TimeStart.Time).Hours() > float64(12 *24 *time.Hour) {
  24. // r.StatType = models.TimeStatYear
  25. //}
  26. }
  27. type OrderNumTimeStatRespVO struct {
  28. Key string
  29. OrderCount int64
  30. }
  31. type OrderNumUserStatReqVO struct {
  32. Page core.Page `json:"page"`
  33. Search struct {
  34. StatType models.TimeStatType
  35. TimeStart models.MyTime `json:"timeStart"`
  36. TimeEnd models.MyTime `json:"timeEnd"`
  37. OrderStatus int `json:"orderStatus"`
  38. }
  39. }