fix_step null false

This commit is contained in:
2025-12-10 17:51:28 +08:00
parent 83d0fd6587
commit 09d7a4f076
4 changed files with 16 additions and 21 deletions

View File

@@ -20,8 +20,8 @@ type Product struct {
Price decimal.Decimal `gorm:"type:decimal(10,2);not null;default:0" comment:"产品价格"`
CostPrice decimal.Decimal `gorm:"type:decimal(10,2);default:0" comment:"成本价"`
Remark string `gorm:"type:text" comment:"备注"`
IsEnabled bool `gorm:"default:true" comment:"是否启用"`
IsVisible bool `gorm:"default:true" comment:"是否展示"`
IsEnabled bool `gorm:"default:false" comment:"是否启用"`
IsVisible bool `gorm:"default:false" comment:"是否展示"`
IsPackage bool `gorm:"default:false" comment:"是否组合包"`
// 组合包相关关联
PackageItems []*ProductPackageItem `gorm:"foreignKey:PackageID" comment:"组合包项目列表"`
@@ -62,7 +62,6 @@ func (p *Product) CanBeSubscribed() bool {
return p.IsValid()
}
// UpdateSEO 更新SEO信息
func (p *Product) UpdateSEO(title, description, keywords string) {
p.SEOTitle = title
@@ -115,4 +114,4 @@ func (p *Product) GetOldID() string {
// HasOldID 检查是否有旧ID
func (p *Product) HasOldID() bool {
return p.OldID != nil && *p.OldID != ""
}
}