manual_user_classify.go 952 B

123456789101112131415161718192021222324252627
  1. package eta_trial
  2. import (
  3. "hongze/hz_crm_eta/global"
  4. "time"
  5. )
  6. type ManualUserClassify struct {
  7. ManualUserClassifyId int `gorm:"primaryKey;column:manual_user_classify_id;type:int(11);not null" json:"manual_user_classify_id"`
  8. AdminId int `gorm:"uniqueIndex:idx_sysuser_class;column:admin_id;type:int(11);default:0" json:"admin_id"`
  9. ClassifyId int `gorm:"uniqueIndex:idx_sysuser_class;column:classify_id;type:int(11)" json:"classify_id"`
  10. CreateTime time.Time `gorm:"column:create_time;type:datetime" json:"create_time"`
  11. }
  12. func (m *ManualUserClassify) TableName() string {
  13. return "manual_user_classify"
  14. }
  15. func (m *ManualUserClassify) Create() (err error) {
  16. err = global.MYSQL["hz_data_trial"].Create(m).Error
  17. return
  18. }
  19. func (m *ManualUserClassify) BatchCreate(items []*ManualUserClassify) (err error) {
  20. err = global.MYSQL["hz_data_trial"].CreateInBatches(items, len(items)).Error
  21. return
  22. }