english_company_log.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. const (
  7. EnglishCompanyLogOptionTypeAdd = iota + 1
  8. EnglishCompanyLogOptionTypeEdit
  9. EnglishCompanyLogOptionTypeDel
  10. EnglishCompanyLogOptionTypeEditEnabled
  11. EnglishCompanyLogOptionTypeSavePermission
  12. )
  13. // EnglishCompanyLog 英文客户操作日志表
  14. type EnglishCompanyLog struct {
  15. Id int `orm:"column(id);pk"`
  16. CompanyId int `description:"英文客户ID"`
  17. AdminId int `description:"操作人ID"`
  18. OptionData string `description:"操作数据-JSON"`
  19. OptionType int `description:"操作类型:1-新增;2-编辑;3-删除"`
  20. CreateTime time.Time `description:"创建时间"`
  21. }
  22. func (item *EnglishCompanyLog) TableName() string {
  23. return "english_company_log"
  24. }
  25. func (item *EnglishCompanyLog) Create() (err error) {
  26. o := orm.NewOrmUsingDB("rddp")
  27. id, err := o.Insert(item)
  28. if err != nil {
  29. return
  30. }
  31. item.Id = int(id)
  32. return
  33. }
  34. func (item *EnglishCompanyLog) Update(cols []string) (err error) {
  35. o := orm.NewOrmUsingDB("rddp")
  36. _, err = o.Update(item, cols...)
  37. return
  38. }