apply_collection.go 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CollectionBannerResp struct {
  7. Title string `description:"标题"`
  8. IndexImg string `description:"小程序封面图"`
  9. Path string `description:"小程序路径"`
  10. }
  11. type CollectionBannerListResp struct {
  12. ListA []*CollectionBannerResp
  13. ListB []*CollectionBannerResp
  14. }
  15. type CollectionDetailResp struct {
  16. HttpUrl string `description:"跳转地址"`
  17. }
  18. type ApplyCollectionReq struct {
  19. Content string `description:"内容"`
  20. }
  21. // 精选看板申请表
  22. type CygxApplyCollection struct {
  23. ApplyCollectionId int `orm:"column(apply_collection_id);pk" description:"主键ID"`
  24. UserId int `description:"用户ID"` // 用户ID
  25. Mobile string `description:"手机号"` // 手机号
  26. Email string `description:"邮箱"` // 邮箱
  27. CompanyId int `description:"公司ID"` // 公司ID
  28. CompanyName string `description:"公司名称"` // 公司名称
  29. RealName string `description:"用户实际名称"` // 用户实际名称
  30. SellerName string `description:"所属销售"` // 所属销售
  31. CreateTime time.Time `description:"创建时间"` // 创建时间
  32. ModifyTime time.Time `description:"修改时间"` // 修改时间
  33. RegisterPlatform int `description:"来源 1小程序,2:网页"` // 来源 1小程序,2:网页
  34. Content string `description:" 内容"` // 内容
  35. }
  36. // 精选看板申请表
  37. type CygxApplyCollectionResp struct {
  38. ApplyCollectionId int `gorm:"column:"`
  39. UserId int `gorm:"column:"` // 用户ID
  40. Mobile string `gorm:"column:"` // 手机号
  41. Email string `gorm:"column:"` // 邮箱
  42. CompanyId int `gorm:"column:;default:0"` // 公司ID
  43. CompanyName string `gorm:"column:"` // 公司名称
  44. RealName string `gorm:"column:"` // 用户实际名称
  45. SellerName string `gorm:"column:"` // 所属销售
  46. CreateTime time.Time `gorm:"column:"` // 创建时间
  47. ModifyTime time.Time `gorm:"column:"` // 修改时间
  48. RegisterPlatform int `gorm:"column:;default:1;NOT NULL"` // 来源 1小程序,2:网页
  49. Content string `gorm:"column:;NOT NULL"` // 内容
  50. }
  51. // 添加信息
  52. func AddCygxApplyCollection(item *CygxApplyCollection) (lastId int64, err error) {
  53. o := orm.NewOrm()
  54. lastId, err = o.Insert(item)
  55. return
  56. }
  57. // 通过ID获取详情
  58. func GetCygxApplyCollectionDetail(applyCollectionId int) (item *CygxApplyCollectionResp, err error) {
  59. o := orm.NewOrm()
  60. sql := `SELECT * FROM cygx_apply_collection WHERE apply_collection_id=? `
  61. err = o.Raw(sql, applyCollectionId).QueryRow(&item)
  62. return
  63. }
  64. type CygxApplyCollectionDetailResp struct {
  65. Detail *CygxApplyCollectionResp
  66. }