product_interior_history.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxProductInteriorHistory struct {
  7. Id int `orm:"column(id);pk"`
  8. ProductInteriorId int
  9. UserId int
  10. CreateTime time.Time
  11. Mobile string `description:"手机号"`
  12. Email string `description:"邮箱"`
  13. CompanyId int `description:"公司id"`
  14. CompanyName string `description:"公司名称"`
  15. ModifyTime time.Time `description:"修改时间"`
  16. RealName string `description:"用户实际名称"`
  17. SellerName string `description:"所属销售"`
  18. }
  19. // 添加历史信息
  20. func AddCygxProductInteriorHistory(item *CygxProductInteriorHistory) (lastId int64, err error) {
  21. o := orm.NewOrm()
  22. item.ModifyTime = time.Now()
  23. lastId, err = o.Insert(item)
  24. return
  25. }
  26. // 列表
  27. func GetCygxProductInteriorHistoryList(condition string, pars []interface{}) (items []*CygxProductInteriorHistory, err error) {
  28. o := orm.NewOrm()
  29. sql := `SELECT * FROM cygx_product_interior_history as art WHERE 1= 1 `
  30. if condition != "" {
  31. sql += condition
  32. }
  33. _, err = o.Raw(sql, pars).QueryRows(&items)
  34. return
  35. }