activity_signup_break.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package cygx
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxActivitySignupBreak struct {
  7. Id int `orm:"column(id);pk"`
  8. ActivityId int `description:"活动ID"`
  9. UserId int `description:"用户ID"`
  10. CreateTime time.Time `description:"创建时间"`
  11. Mobile string `description:"手机号"`
  12. Email string `description:"邮箱"`
  13. CompanyId int `description:"公司id"`
  14. CompanyName string `description:"公司名称"`
  15. RealName string `description:"用户实际名称"`
  16. SellerName string `description:"所属销售"`
  17. }
  18. // 添加爽约记录
  19. func AddCygxActivitySignupBreak(item *CygxActivitySignupBreak) (lastId int64, err error) {
  20. o := orm.NewOrmUsingDB("hz_cygx")
  21. lastId, err = o.Insert(item)
  22. return
  23. }
  24. // 批量添加
  25. func AddCygxActivitySignupBreakList(items []*CygxActivitySignupBreak) (lastId int64, err error) {
  26. lenitems := len(items)
  27. if lenitems == 0 {
  28. return
  29. }
  30. o := orm.NewOrmUsingDB("hz_cygx")
  31. _, err = o.InsertMulti(1, items)
  32. return
  33. }
  34. // 删除
  35. func DeleteCygxActivitySignupBreakById(activityId int) (err error) {
  36. o := orm.NewOrmUsingDB("hz_cygx")
  37. sql := ` DELETE FROM cygx_activity_signup_break WHERE activity_id =? `
  38. _, err = o.Raw(sql, activityId).Exec()
  39. return
  40. }