activity_user_remarks.go 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package cygx
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxActivityUserRemarks struct {
  7. Id int `orm:"column(id);pk"`
  8. ActivityId int `description:"活动ID "`
  9. Mobile string `description:"参会人手机号 "`
  10. AdminId int `description:"销售/管理员ID"`
  11. RealName string `description:"销售/管理员姓名"`
  12. Content string `description:"备注信息"`
  13. CreateTime time.Time `description:"创建时间"`
  14. }
  15. type ActivityUserRemarksAddReq struct {
  16. ActivityId int `description:"活动ID "`
  17. Mobile string `description:"参会人手机号 "`
  18. Content string `description:"备注信息"`
  19. }
  20. type CygxActivityUserRemarksResp struct {
  21. Id int `orm:"column(id);pk"`
  22. ActivityId int `description:"活动ID "`
  23. Mobile string `description:"参会人手机号 "`
  24. AdminId int `description:"销售/管理员ID"`
  25. RealName string `description:"销售/管理员姓名"`
  26. Content string `description:"备注信息"`
  27. CreateTime string `description:"创建时间"`
  28. }
  29. type CygxActivityUserRemarksListResp struct {
  30. List []*CygxActivityUserRemarksResp
  31. }
  32. // 新增
  33. func AddCygxActivityUserRemarks(item *CygxActivityUserRemarks) (err error) {
  34. o := orm.NewOrmUsingDB("hz_cygx")
  35. _, err = o.Insert(item)
  36. return
  37. }
  38. // 获取备注列表
  39. func GetCygxActivityUserRemarksLlist(mobile string) (items []*CygxActivityUserRemarksResp, err error) {
  40. o := orm.NewOrmUsingDB("hz_cygx")
  41. sql := ` SELECT * FROM cygx_activity_user_remarks WHERE mobile IN (` + mobile + `) ORDER BY id DESC`
  42. _, err = o.Raw(sql).QueryRows(&items)
  43. return
  44. }
  45. // 获取备注列表
  46. func GetCygxActivityUserRemarksLlistByActivityId(mobile string, activityId int) (items []*CygxActivityUserRemarksResp, err error) {
  47. o := orm.NewOrmUsingDB("hz_cygx")
  48. sql := ` SELECT * FROM cygx_activity_user_remarks WHERE mobile IN (` + mobile + `) AND activity_id = ? ORDER BY id DESC`
  49. _, err = o.Raw(sql, activityId).QueryRows(&items)
  50. return
  51. }