package eta_trial import ( "hongze/hz_crm_eta/global" "time" ) type EdbdataClassify struct { ClassifyId int `gorm:"primaryKey;column:classify_id;type:int(11);not null" json:"classify_id"` ClassifyName string `gorm:"index:idx_classify_name;column:classify_name;type:varchar(100);default:''" json:"classify_name"` // 分类名称 ParentId int `gorm:"index:idx_parent_id;column:parent_id;type:int(11);default:0" json:"parent_id"` // 父级分类id CreateTime time.Time `gorm:"column:create_time;type:datetime" json:"create_time"` Sort int `gorm:"column:sort;type:int(11);default:0" json:"sort"` // 分类排序 IsShow int `gorm:"column:is_show;type:tinyint(4);default:0" json:"is_show"` // 1:展示,0:不展示 } func (m *EdbdataClassify) TableName() string { return "edbdata_classify" } func (m *EdbdataClassify) GetItemsByCondition(cond string, pars []interface{}, fieldArr []string, orderRule string) (items []*EdbdataClassify, err error) { order := `create_time DESC` if orderRule != "" { order = orderRule } err = global.MYSQL["edb_trial"].Where(cond, pars...).Order(order).Find(&items).Error return }