package models import ( "time" "github.com/ouxuanserver/osmanthuswine/src/core" ) //模块服务表 type ModuleService struct { Id int64 `json:"id"` Name string `json:"name" description:"模块的名称"` Price float64 `json:"price" description:"模块价格"` Free string `json:"free" description:"模块是否收费[收费|免费]"` IsDelete bool `json:"is_delete" xorm:"default(0)"` CreatedAt time.Time `json:"-" xorm:"created" description:"创建时间"` UpdatedAt time.Time `json:"-" xorm:"updated" description:"更新时间"` } func (t *ModuleService) GetByName(name string) (bool, error) { return core.GetXormAuto().Where("is_delete=0 and name=?", name).Get(t) }