user_business_card.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package order
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. //"time"
  6. )
  7. type CygxUserBusinessCard struct {
  8. Id int `orm:"column(id);pk"`
  9. BusinessCardUrl string `description:"名片地址"`
  10. UserId int `description:"用户ID"`
  11. RealName string `description:"用户实际名称"`
  12. Mobile string `description:"手机号"`
  13. CompanyName string `description:"公司名称"`
  14. CreateTime time.Time
  15. ModifyTime time.Time `description:"修改时间"`
  16. RegisterPlatform int `description:"来源"`
  17. InviteName string `description:"邀请人"`
  18. }
  19. type CygxUserBusinessCardReq struct {
  20. BusinessCardUrl string `description:"名片地址"`
  21. RealName string `description:"用户实际名称"`
  22. Mobile string `description:"手机号"`
  23. CompanyName string `description:"公司名称"`
  24. InviteName string `description:"邀请人"`
  25. }
  26. func GetCygxUserBusinessCardCount(userId int) (count int, err error) {
  27. o := orm.NewOrm()
  28. sql := `SELECT COUNT(1) AS count FROM cygx_user_business_card WHERE user_id=? `
  29. err = o.Raw(sql, userId).QueryRow(&count)
  30. return
  31. }
  32. // 新增
  33. func AddCygxUserBusinessCard(item *CygxUserBusinessCard) (err error) {
  34. o := orm.NewOrm()
  35. _, err = o.Insert(item)
  36. return
  37. }