user_admin_share_history.go 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. package cygx
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "github.com/rdlucklib/rdluck_tools/paging"
  5. "time"
  6. )
  7. type CygxUserAdminShareHistory struct {
  8. UserAdminShareHistoryId int `orm:"column(user_admin_share_history_id);pk";comment:"主键ID"`
  9. Action string `comment:"动作内容"`
  10. UserId int `comment:"用户ID"`
  11. Mobile string `comment:"手机号"`
  12. Email string `comment:"邮箱"`
  13. CompanyId int `comment:"公司ID"`
  14. CompanyName string `comment:"公司名称"`
  15. RealName string `comment:"用户实际名称"`
  16. SellerName string `comment:"所属销售名称"`
  17. SellerId int `comment:"所属销售ID"`
  18. ShareId int `comment:"分享人ID"`
  19. ShareName string `comment:"分享人姓名"`
  20. Source string `comment:"来源(article, activity, login)"`
  21. SourceId int `comment:"来源 ID"`
  22. SourceTitle string `comment:"来源名称,活动或者报告标题"`
  23. RegisterPlatform int `comment:"注册平台(1: 小程序, 2: 网页)"`
  24. CreateTime time.Time `comment:"创建时间"`
  25. ModifyTime time.Time `comment:"修改时间"`
  26. }
  27. type CygxUserAdminShareHistoryResp struct {
  28. UserAdminShareHistoryId int `orm:"column(user_admin_share_history_id);pk";comment:"主键ID"`
  29. Action string `comment:"动作内容"`
  30. UserId int `comment:"用户ID"`
  31. Mobile string `comment:"手机号"`
  32. Email string `comment:"邮箱"`
  33. CompanyId int `comment:"公司ID"`
  34. CompanyName string `comment:"公司名称"`
  35. RealName string `comment:"用户实际名称"`
  36. ShareId int `comment:"分享人ID"`
  37. ShareName string `comment:"分享人姓名"`
  38. Source string `comment:"来源(article, activity, login)"`
  39. SourceId int `comment:"来源 ID"`
  40. SourceTitle string `comment:"来源名称,活动或者报告标题"`
  41. RegisterPlatform int `comment:"注册平台(1: 小程序, 2: 网页)"`
  42. RegisterPlatformText string `comment:"注册平台(1: 小程序, 2: 网页)"`
  43. CreateTime string `comment:"创建时间"`
  44. HttpUrl string `comment:"跳转地址"`
  45. }
  46. type GetCygxUserAdminShareHistoryListResp struct {
  47. Paging *paging.PagingItem `description:"分页数据"`
  48. List []*CygxUserAdminShareHistoryResp
  49. }
  50. // 获取数量
  51. func GetCygxUserAdminShareHistoryCount(condition string, pars []interface{}) (count int, err error) {
  52. sqlCount := ` SELECT COUNT(1) AS count FROM cygx_user_admin_share_history as a WHERE 1= 1 `
  53. if condition != "" {
  54. sqlCount += condition
  55. }
  56. o := orm.NewOrmUsingDB("hz_cygx")
  57. err = o.Raw(sqlCount, pars).QueryRow(&count)
  58. return
  59. }
  60. // 列表
  61. func GetCygxUserAdminShareHistoryList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxUserAdminShareHistoryResp, err error) {
  62. o := orm.NewOrmUsingDB("hz_cygx")
  63. sql := `SELECT * FROM cygx_user_admin_share_history as a WHERE 1= 1 `
  64. if condition != "" {
  65. sql += condition
  66. }
  67. sql += ` LIMIT ?,? `
  68. _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
  69. return
  70. }