activity_special_trip_bill.go 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. package data_manage
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxActivitySpecialTripBill struct {
  7. Id int `orm:"column(id);pk"`
  8. UserId int `description:"用户id,多个用,隔开"`
  9. ActivityId int `description:"活动ID"`
  10. CreateTime time.Time `description:"创建时间"`
  11. Mobile string `description:"手机号"`
  12. Email string `description:"邮箱号"`
  13. CompanyId int `description:"公司ID"`
  14. CompanyName string `description:"公司名称"`
  15. RealName string `description:"用户实际名称"`
  16. AdminId int `description:"销售/管理员ID"`
  17. Source int `description:"来源,1小程序,2后台添加, 3开发人员手动添加"`
  18. BillDetailed int `description:"流水明细,判断是进账还是出账"`
  19. DoType int `description:"操作方式,1报名,2取消报名"`
  20. RegisterPlatform int `description:"来源 1小程序,2:网页"`
  21. ChartPermissionId int `description:"行业id"`
  22. Way int `description:"1报名,取消报名。2到会取消到会 3转正或清零 4取消活动"`
  23. Content string `description:"内容"`
  24. Total string `description:"总和"`
  25. }
  26. type CygxActivitySpecialTripBillList struct {
  27. Id int `orm:"column(id);pk"`
  28. UserId int `description:"用户id,多个用,隔开"`
  29. ActivityId int `description:"活动ID"`
  30. CreateTime time.Time `description:"创建时间"`
  31. Mobile string `description:"手机号"`
  32. Email string `description:"邮箱号"`
  33. CompanyId int `description:"公司ID"`
  34. CompanyName string `description:"公司名称"`
  35. RealName string `description:"用户实际名称"`
  36. AdminId int `description:"销售/管理员ID"`
  37. Source int `description:"来源,1小程序,2后台添加, 3开发人员手动添加"`
  38. BillDetailed int `description:"流水明细,判断是进账还是出账"`
  39. DoType int `description:"操作方式,1报名,2取消报名"`
  40. RegisterPlatform int `description:"来源 1小程序,2:网页"`
  41. ChartPermissionId int `description:"行业id"`
  42. ChartPermissionName string `description:"行业名称"`
  43. }
  44. // 添加
  45. func AddCygxActivitySpecialTripBill(item *CygxActivitySpecialTripBill) (err error) {
  46. o := orm.NewOrmUsingDB("hz_cygx")
  47. _, err = o.Insert(item)
  48. if err != nil {
  49. return
  50. }
  51. return
  52. }
  53. func GetCygxActivitySpecialTripBillList(condition string, pars []interface{}) (item []*CygxActivitySpecialTripBillList, err error) {
  54. o := orm.NewOrmUsingDB("hz_cygx")
  55. sql := `SELECT
  56. b.*
  57. FROM
  58. cygx_activity_special_trip_bill AS b
  59. WHERE
  60. 1 = 1` + condition
  61. _, err = o.Raw(sql, pars).QueryRows(&item)
  62. return
  63. }
  64. type AirborneCount struct {
  65. Count int
  66. ChartPermissionId int ` description:"品种权限ID"`
  67. }
  68. //// 获取空降的公司报名的记录
  69. //func GetActivitySpecialTripAirborneListByActivitySpecial(condition string, pars []interface{}) (items []*AirborneCount, err error) {
  70. // sqlCount := ` SELECT chart_permission_id,COUNT(1) AS count
  71. // FROM
  72. // cygx_activity_special_meeting_detail AS t
  73. // INNER JOIN cygx_activity_special AS a ON a.activity_id = t.activity_id
  74. // WHERE
  75. // 1= 1 AND YEAR ( t.create_time )= YEAR (NOW()) ` + condition + `GROUP BY chart_permission_id`
  76. // o := orm.NewOrm()
  77. // _, err = o.Raw(sqlCount, pars).QueryRows(&items)
  78. // return
  79. //}
  80. //
  81. //// 获取空降的公司报名的记录
  82. //func GetActivitySpecialTripAirborneCountByActivitySpecial(condition string, pars []interface{}) (count int, err error) {
  83. // sqlCount := ` SELECT COUNT(1) AS count
  84. // FROM
  85. // cygx_activity_special_meeting_detail AS t
  86. // INNER JOIN cygx_activity_special AS a ON a.activity_id = t.activity_id
  87. // WHERE
  88. // 1= 1 AND YEAR ( t.create_time )= YEAR (NOW()) ` + condition
  89. // o := orm.NewOrm()
  90. // err = o.Raw(sqlCount, pars).QueryRow(&count)
  91. // return
  92. //}
  93. type CygxActivitySpecialTripBillDetailList struct {
  94. Id int `orm:"column(id);pk"`
  95. UserId int `description:"用户id,多个用,隔开"`
  96. ActivityId int `description:"活动ID"`
  97. ResearchTheme string `description:"调研主题"`
  98. CreateTime time.Time `description:"创建时间"`
  99. Mobile string `description:"手机号"`
  100. Email string `description:"邮箱号"`
  101. CompanyId int `description:"公司ID"`
  102. CompanyName string `description:"公司名称"`
  103. RealName string `description:"用户实际名称"`
  104. AdminId int `description:"销售/管理员ID"`
  105. Source int `description:"来源,1小程序,2后台添加, 3开发人员手动添加"`
  106. BillDetailed int `description:"流水明细,判断是进账还是出账"`
  107. DoType int `description:"操作方式,1报名,2取消报名"`
  108. RegisterPlatform int `description:"来源 1小程序,2:网页"`
  109. ChartPermissionId int `description:"行业id"`
  110. ChartPermissionName string `description:"行业名称"`
  111. Content string `description:"内容"`
  112. Way int `description:"1报名,取消报名。2到会取消到会 3转正或清零 4取消活动"`
  113. }
  114. type CygxActivitySpecialPointsBillRespItem struct {
  115. Id int `gorm:"column:id;primary_key;AUTO_INCREMENT"`
  116. Content string `gorm:"column:content" ` // 内容说明
  117. Total string `gorm:"column:points;default:0;NOT NULL" ` // 合计
  118. CreateTime string `gorm:"column:create_time" ` // 创建时间
  119. CompanyId int `gorm:"column:company_id;default:0" ` // 公司ID
  120. CompanyName string `gorm:"column:company_name" ` // 公司名称
  121. RealName string `gorm:"column:real_name"` // 用户实际名称
  122. BillDetailed int `gorm:"column:bill_detailed;default:0;NOT NULL" json:""` // 流水明细,判断是进账还是出账
  123. ActivityName string `description:"活动标题"`
  124. ChartPermissionId int `description:"行业id"`
  125. ChartPermissionName string `description:"行业名称"`
  126. }
  127. type CygxActivitySpecialPointsBillResp struct {
  128. List []*CygxActivitySpecialPointsBillRespItem
  129. }