Files
sale/backend/internal/models/purchase_group.go
T
admin 4e86a9a6ad
Build and Push Docker Image / build-and-push (push) Successful in 1m0s
Build and Push Docker Image / deploy (push) Successful in 7s
Docker Build / Build and Push Docker Image (push) Has been cancelled
Docker Build / Deploy to Server (push) Has been cancelled
feat: 添加购买分组功能,替代跨分类购物选项
2026-07-05 21:51:32 +08:00

22 lines
644 B
Go

package models
import (
"time"
"gorm.io/gorm"
)
type PurchaseGroup struct {
ID uint `gorm:"primaryKey" json:"id"`
Name string `gorm:"size:100;not null;uniqueIndex" json:"name"`
Description string `json:"description"`
SortOrder int `gorm:"default:0" json:"sort_order"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
Categories []Category `gorm:"foreignKey:PurchaseGroupID" json:"categories,omitempty"`
}
func (PurchaseGroup) TableName() string {
return "purchase_groups"
}