You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
756 B

package goods
import "recook/internal/dbc"
type Category struct {
ID uint `gorm:"column:id;primary_key" json:"id"`
Name string `gorm:"column:name" json:"name"`
ParentId uint `gorm:"column:parent_id" json:"parentId"`
Depth uint `gorm:"column:depth" json:"-"`
LogoURL string `gorm:"column:logo_url" json:"logoUrl"`
Location uint `gorm:"column:location" json:"location"`
Show uint `gorm:"column:show" json:"show"`
IsAllow bool `gorm:"column:is_allow" json:"is_allow"`
}
func (c *Category) TableName() string {
return "recook_goods_category"
}
//通过id来查询类目表内容
func (c *Category) SearchById(id uint) (rest Category) {
dbc.DB.Table("recook_goods_category").Where("id=?", id).First(&rest)
return
}