34 lines
2.5 KiB
Go
34 lines
2.5 KiB
Go
|
|
// Models generated by mesh dev cli,@Author: David Yan(david.yan@qq.com).
|
|||
|
|
package models
|
|||
|
|
|
|||
|
|
import (
|
|||
|
|
"gorm.io/gorm"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
// OrderDetails /* 订单详情 */
|
|||
|
|
type OrderDetails struct {
|
|||
|
|
gorm.Model
|
|||
|
|
SupplyId int64 `gorm:"column:supply_id;default:0;supply_id;"` // 供应商ID
|
|||
|
|
SummaryIdentity string `gorm:"column:summary_identity;type:varchar(36);Index;" json:"summary_identity"` // 订单identity
|
|||
|
|
OrderNo string `gorm:"column:order_no;type:varchar(36);index;not null;" json:"order_no"` // 订单号
|
|||
|
|
ProductID int64 `gorm:"column:product_id;not null;" json:"product_id"` // 商品ID
|
|||
|
|
ProductIdentity string `gorm:"column:product_identity;type:varchar(36);Index;" json:"product_identity"` // 产品唯一标识,24位NanoID,36位为UUID
|
|||
|
|
SpecID int64 `gorm:"column:spec_id;" json:"spec_id"` // 商品规格ID
|
|||
|
|
Type int8 `gorm:"column:type;default:1;" json:"type"` // 商品类型:Product=1 实体商品,Service=2 服务,Membership=3 会员服务,Other=4 其它
|
|||
|
|
Title string `gorm:"column:title;type:varchar(255);default:'';" json:"title"` // 产品标题
|
|||
|
|
SpecTitle string `gorm:"column:spec_title;type:varchar(255);default:'';" json:"spec_title"` // 产品规格标题
|
|||
|
|
SpecNo string `gorm:"column:spec_no;type:varchar(255);default:'';" json:"spec_no"` // 产品规格编号
|
|||
|
|
CoverImage string `gorm:"column:cover_image;type:varchar(255);default:'';" json:"cover_image"` // 封面
|
|||
|
|
ProductArgs string `gorm:"column:product_args;type:text;default:'';" json:"product_args"` // 产品参数
|
|||
|
|
Number int32 `gorm:"column:number;default:0;" json:"number"` // 订单产品数量
|
|||
|
|
UnitPrice int64 `gorm:"column:unit_price;default:0;" json:"unit_price"` // 单品实际价格
|
|||
|
|
SalesPrice int64 `gorm:"column:sales_price;default:0;" json:"sales_price"` // 单品原价
|
|||
|
|
GasType int32 `gorm:"column:gas_types;default:1;" json:"gas_types"` // 商品类型:1其它商品 2按瓶计费,3 按kg计费
|
|||
|
|
TotalPrice int64 `gorm:"column:total_price;default:0;" json:"total_price"` // 产品总价
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// TableName .
|
|||
|
|
func (table *OrderDetails) TableName() string {
|
|||
|
|
return "order_details" //对应数据库表名
|
|||
|
|
}
|