Merge branch 'main' of ssh://git.ma-al.com:8822/goc_daniel/b2b into product-procedures
This commit is contained in:
@@ -30,8 +30,6 @@ type ProductRow struct {
|
||||
type MeiliSearchProduct struct {
|
||||
ProductID uint `gorm:"column:id_product"`
|
||||
Name string `gorm:"column:name"`
|
||||
Active uint8 `gorm:"column:active"`
|
||||
Price float64 `gorm:"column:price"`
|
||||
Description string `gorm:"column:description"`
|
||||
DescriptionShort string `gorm:"column:description_short"`
|
||||
Usage string `gorm:"column:used_for"`
|
||||
@@ -44,4 +42,6 @@ type MeiliSearchProduct struct {
|
||||
CategoryID uint `gorm:"column:id_category"`
|
||||
CategoryName string `gorm:"column:category_name"`
|
||||
Variations uint `gorm:"column:variations"`
|
||||
CategoryIDs []uint `gorm:"-"` // All category IDs including children for filtering
|
||||
CoverImage string `gorm:"-"` // Cover image URL (not indexed)
|
||||
}
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
package model
|
||||
|
||||
type B2BTopMenu struct {
|
||||
MenuID int `gorm:"column:menu_id;primaryKey;autoIncrement" json:"menu_id"`
|
||||
Label string `gorm:"column:label;type:longtext;not null;default:'{}'" json:"label"`
|
||||
ParentID *int `gorm:"column:parent_id;index:FK_b2b_top_menu_parent_id" json:"parent_id,omitempty"`
|
||||
Params string `gorm:"column:params;type:longtext;not null;default:'{}'" json:"params"`
|
||||
Active int8 `gorm:"column:active;type:tinyint;not null;default:1" json:"active"`
|
||||
Position int `gorm:"column:position;not null;default:1" json:"position"`
|
||||
import "encoding/json"
|
||||
|
||||
Parent *B2BTopMenu `gorm:"foreignKey:ParentID;references:MenuID;constraint:OnDelete:RESTRICT,OnUpdate:RESTRICT" json:"parent,omitempty"`
|
||||
Children []B2BTopMenu `gorm:"foreignKey:ParentID" json:"children,omitempty"`
|
||||
type B2BTopMenu struct {
|
||||
MenuID int `gorm:"column:menu_id;primaryKey;autoIncrement" json:"menu_id"`
|
||||
Label json.RawMessage `gorm:"column:label;type:longtext;not null;default:'{}'" json:"label"`
|
||||
ParentID *int `gorm:"column:parent_id;index:FK_b2b_top_menu_parent_id" json:"parent_id,omitempty"`
|
||||
Params string `gorm:"column:params;type:longtext;not null;default:'{}'" json:"params"`
|
||||
Active int8 `gorm:"column:active;type:tinyint;not null;default:1" json:"active"`
|
||||
Position int `gorm:"column:position;not null;default:1" json:"position"`
|
||||
|
||||
Parent *B2BTopMenu `gorm:"foreignKey:ParentID;references:MenuID;constraint:OnDelete:RESTRICT,OnUpdate:RESTRICT" json:"parent,omitempty"`
|
||||
Children []*B2BTopMenu `gorm:"foreignKey:ParentID" json:"children,omitempty"`
|
||||
}
|
||||
|
||||
func (B2BTopMenu) TableName() string {
|
||||
|
||||
Reference in New Issue
Block a user