完善定价与套餐关联表结构

This commit is contained in:
2026-03-24 16:25:21 +08:00
parent c9995ef566
commit 5ffa151f58
28 changed files with 1550 additions and 112 deletions

View File

@@ -9,11 +9,12 @@ import (
// ProductSku 产品SKU表
type ProductSku struct {
core.Model
ProductID int32 `json:"product_id" gorm:"column:product_id"` // 产品ID
Code string `json:"code" gorm:"column:code"` // SSKU 代码:格式为 key=value,key=value,...其中key:value 是 SKU 的属性,多个属性用逗号分隔
Name string `json:"name" gorm:"column:name"` // SKU 可读名称
Price decimal.Decimal `json:"price" gorm:"column:price"` // 定价
Discount float32 `json:"discount" gorm:"column:discount"` // 折扣0 - 1 的小数,表示 xx 折
ProductID int32 `json:"product_id" gorm:"column:product_id"` // 产品ID
DiscountId int32 `json:"discount_id" gorm:"column:discount_id"` // 折扣0 - 1 的小数,表示 xx 折
Code string `json:"code" gorm:"column:code"` // SSKU 代码:格式为 key=value,key=value,...其中key:value 是 SKU 的属性,多个属性用逗号分隔
Name string `json:"name" gorm:"column:name"` // SKU 可读名称
Price decimal.Decimal `json:"price" gorm:"column:price"` // 定价
Product *Product `json:"product,omitempty" gorm:"foreignKey:ProductID"`
Product *Product `json:"product,omitempty" gorm:"foreignKey:ProductID"`
Discount *ProductDiscount `json:"discount,omitempty" gorm:"foreignKey:DiscountId"`
}