user_label_activity.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxUserLabelActivity struct {
  7. Id int `orm:"column(id);pk"`
  8. UserId int `description:"用户ID"`
  9. CompanyId int `description:"公司id"`
  10. RealName string `description:"用户实际名称"`
  11. Mobile string `description:"手机号"`
  12. Email string `description:"邮箱"`
  13. Label string `description:"标签内容"`
  14. ActivityId int `description:"活动ID"`
  15. IndustrialManagementId int `description:"cygx_industrial_management表的主键ID"`
  16. CreateTime time.Time `description:"创建时间"`
  17. ModifyTime time.Time `description:"更新时间"`
  18. }
  19. // 列表
  20. func GetCygxUserLabelActivity(condition string, pars []interface{}) (items []*CygxUserLabelActivity, err error) {
  21. o := orm.NewOrm()
  22. sql := `SELECT * FROM cygx_user_label_activity as art WHERE 1= 1 `
  23. if condition != "" {
  24. sql += condition
  25. }
  26. _, err = o.Raw(sql, pars).QueryRows(&items)
  27. return
  28. }
  29. // 批量添加
  30. func AddCygxUserLabelActivityList(items []*CygxUserLabelActivity) (lastId int64, err error) {
  31. lenitems := len(items)
  32. if lenitems == 0 {
  33. return
  34. }
  35. o := orm.NewOrm()
  36. _, err = o.InsertMulti(1, items)
  37. return
  38. }