package model import ( "gorm.io/gorm" ) // ShopPackageAllocation 店铺单套餐分配模型 // 用于对单个套餐设置覆盖成本价,优先级高于系列级别的加价计算 // 适用于特殊定价场景(如某个套餐给特定代理优惠价) type ShopPackageAllocation struct { gorm.Model BaseModel `gorm:"embedded"` ShopID uint `gorm:"column:shop_id;index;not null;comment:被分配的店铺ID" json:"shop_id"` PackageID uint `gorm:"column:package_id;index;not null;comment:套餐ID" json:"package_id"` AllocationID uint `gorm:"column:allocation_id;index;not null;comment:关联的系列分配ID" json:"allocation_id"` CostPrice int64 `gorm:"column:cost_price;type:bigint;not null;comment:覆盖的成本价(分)" json:"cost_price"` Status int `gorm:"column:status;type:int;default:1;not null;comment:状态 1-启用 2-禁用" json:"status"` } // TableName 指定表名 func (ShopPackageAllocation) TableName() string { return "tb_shop_package_allocation" }