package models import ( "eta_gn/eta_api/global" "time" ) const ( EnglishCompanyLogOptionTypeAdd = iota + 1 EnglishCompanyLogOptionTypeEdit EnglishCompanyLogOptionTypeDel EnglishCompanyLogOptionTypeEditEnabled EnglishCompanyLogOptionTypeSavePermission ) // EnglishCompanyLog 英文客户操作日志表 type EnglishCompanyLog struct { Id int `gorm:"column:id;primary_key:true" description:"日志ID"` CompanyId int `gorm:"column:company_id" description:"英文客户ID"` AdminId int `gorm:"column:admin_id" description:"操作人ID"` OptionData string `gorm:"column:option_data" description:"操作数据-JSON"` OptionType int `gorm:"column:option_type" description:"操作类型:1-新增;2-编辑;3-删除"` CreateTime time.Time `gorm:"column:create_time" description:"创建时间"` } func (item *EnglishCompanyLog) TableName() string { return "english_company_log" } func (item *EnglishCompanyLog) Create() (err error) { //o := orm.NewOrmUsingDB("rddp") //id, err := o.Insert(item) //if err != nil { // return //} //item.Id = int(id) err = global.DmSQL["rddp"].Create(item).Error return } func (item *EnglishCompanyLog) Update(cols []string) (err error) { //o := orm.NewOrmUsingDB("rddp") //_, err = o.Update(item, cols...) err = global.DmSQL["rddp"].Select(cols).Updates(item).Error return }