user_label_activity_special.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxUserLabelActivitySpecial 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 GetCygxUserLabelActivitySpecial(condition string, pars []interface{}) (items []*CygxUserLabelActivitySpecial, err error) {
  21. o := orm.NewOrm()
  22. sql := `SELECT * FROM cygx_user_label_activity_special 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 AddCygxUserLabelActivitySpecialList(items []*CygxUserLabelActivitySpecial) (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. }