package knowledge import "eta_gn/eta_api/global" type KnowledgeResourceFile struct { KnowledgeResourceFileId int `gorm:"column:knowledge_resource_file_id;primaryKey;autoIncrement"` KnowledgeResourceId int `gorm:"column:knowledge_resource_id"` FileUrl string `gorm:"column:file_url"` } func (k KnowledgeResourceFile) TableName() string { return "knowledge_resource_file" } func (k *KnowledgeResourceFile) GetByResourceId(id int) (item []*KnowledgeResourceFile, err error) { sql := "SELECT * FROM knowledge_resource_file WHERE knowledge_resource_id =?" err = global.DmSQL["rddp"].Raw(sql, id).Find(&item).Error return }