cygx_yanxuan_special_collect.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxYanxuanSpecialCollect struct {
  7. CygxYanxuanSpecialCollectId int `orm:"column(cygx_yanxuan_special_collect_id);pk"`
  8. UserId int // 用户ID
  9. Mobile string // 手机号
  10. Email string // 邮箱
  11. CompanyId int // 公司ID
  12. CompanyName string // 公司名称
  13. RealName string // 用户实际名称
  14. SellerName string // 所属销售
  15. CreateTime time.Time // 创建时间
  16. ModifyTime time.Time // 修改时间
  17. RegisterPlatform int // 来源 1小程序,2:网页
  18. YanxuanSpecialId int // cygx_yanxuan_special 表主键ID
  19. }
  20. func AddCygxYanxuanSpecialCollect(item *CygxYanxuanSpecialCollect) (lastId int64, err error) {
  21. o := orm.NewOrm()
  22. lastId, err = o.Insert(item)
  23. return
  24. }
  25. type CollectCygxYanxuanSpecialReq struct {
  26. Id int // 文章id
  27. Status int // 1收藏2取消收藏
  28. }
  29. func DelCygxYanxuanSpecialCollect(userId, articleId int) (err error) {
  30. o := orm.NewOrm()
  31. sql := `DELETE FROM cygx_yanxuan_special_collect WHERE user_id=? AND yanxuan_special_id=? `
  32. _, err = o.Raw(sql, userId, articleId).Exec()
  33. return
  34. }