seller.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. package fms
  2. import (
  3. "hongze/fms_api/models/fms"
  4. )
  5. type CensusSellerGroupList []*fms.CensusSellerGroupInvoiceItem
  6. func (c CensusSellerGroupList) Len() int {
  7. return len(c)
  8. }
  9. func (c CensusSellerGroupList) Less(i, j int) bool {
  10. return c[i].InvoiceAmount > c[j].InvoiceAmount
  11. }
  12. func (c CensusSellerGroupList) Swap(i, j int) {
  13. c[i], c[j] = c[j], c[i]
  14. }
  15. type CensusSellerListByAmountAsc []*fms.CensusSellerInvoiceItem
  16. func (c CensusSellerListByAmountAsc) Len() int {
  17. return len(c)
  18. }
  19. func (c CensusSellerListByAmountAsc) Less(i, j int) bool {
  20. return c[i].InvoiceAmount > c[j].InvoiceAmount
  21. }
  22. func (c CensusSellerListByAmountAsc) Swap(i, j int) {
  23. c[i], c[j] = c[j], c[i]
  24. }
  25. type CensusSellerListByAmountDesc []*fms.CensusSellerInvoiceItem
  26. func (c CensusSellerListByAmountDesc) Len() int {
  27. return len(c)
  28. }
  29. func (c CensusSellerListByAmountDesc) Less(i, j int) bool {
  30. return c[i].InvoiceAmount < c[j].InvoiceAmount
  31. }
  32. func (c CensusSellerListByAmountDesc) Swap(i, j int) {
  33. c[i], c[j] = c[j], c[i]
  34. }
  35. type CensusSellerListByGroupRateAsc []*fms.CensusSellerInvoiceItem
  36. func (c CensusSellerListByGroupRateAsc) Len() int {
  37. return len(c)
  38. }
  39. func (c CensusSellerListByGroupRateAsc) Less(i, j int) bool {
  40. return c[i].GroupRate > c[j].GroupRate
  41. }
  42. func (c CensusSellerListByGroupRateAsc) Swap(i, j int) {
  43. c[i], c[j] = c[j], c[i]
  44. }
  45. type CensusSellerListByGroupRateDesc []*fms.CensusSellerInvoiceItem
  46. func (c CensusSellerListByGroupRateDesc) Len() int {
  47. return len(c)
  48. }
  49. func (c CensusSellerListByGroupRateDesc) Less(i, j int) bool {
  50. return c[i].GroupRate < c[j].GroupRate
  51. }
  52. func (c CensusSellerListByGroupRateDesc) Swap(i, j int) {
  53. c[i], c[j] = c[j], c[i]
  54. }