package models import "time" const CustomerGoodsTableName = TableNamePrefix + "customer_goods" type CustomerGoods struct { Id int64 `json:"id" xorm:"not null pk autoincr INT(11)"` IsDelete bool `json:"is_delete" xorm:"not null default 0 comment('是否删除') TINYINT(1)"` CreatedAt time.Time `json:"created_at" xorm:"created comment('创建时间') TIMESTAMP"` UpdatedAt time.Time `json:"updated_at" xorm:"not null default 'CURRENT_TIMESTAMP' updated comment('更新时间') TIMESTAMP"` ActivityId int64 `json:"activity_id" xorm:"not null default 0 comment('互动id') INT(11)"` AreaId int64 `json:"area_id" xorm:"not null default 0 comment('地区id') INT(11)"` GoodsPicUrl string `json:"goods_pic_url" xorm:"not null default '' comment('商品图片') VARCHAR(255)"` IsForceAdded int `json:"is_force_added" xorm:"not null default 0 comment('是否强制上架0不强制1强制') TINYINT(1)"` GoodType int `json:"good_type" xorm:"not null default 0 comment('商品类型0不需要邮寄1需要邮寄') TINYINT(1)"` FixedField string `json:"fixed_field" xorm:"not null default '' comment('固定不可改字段,|分隔') VARCHAR(255)"` Stock int `json:"stock" xorm:"not null default 0 comment('库存-1的时候无上限') INT(18)"` Name string `json:"name" xorm:"not null default '' comment('商品名称') VARCHAR(255)"` Price float64 `json:"price" xorm:"not null default '' comment('商品单价') DECIMAL(18,2)"` Desc string `json:"desc" xorm:"not null default '' comment('商品介绍') VARCHAR(255)"` // 无关变量 Qrcode string `json:"qrcode" xorm:"-"` } func (t *CustomerGoods) TableName() string { return CustomerGoodsTableName } func (t *CustomerGoods) Alias(name string) string { return AliasTableName(t, name) } //func (t *CustomerGoods) GetById(gid int64) (bool, error) { // return core.GetXormAuto().Where("is_delete=0 and id=?", gid).Get(t) //}