fix
This commit is contained in:
parent
08c4e79836
commit
ba6a042174
|
|
@ -249,15 +249,17 @@ func ImportProduct(product models.Product, db *gorm.DB) error {
|
||||||
tx := *db.Begin()
|
tx := *db.Begin()
|
||||||
|
|
||||||
categories, keywords, errCat := getCats(&tx, product.Categories)
|
categories, keywords, errCat := getCats(&tx, product.Categories)
|
||||||
|
log.Println(categories)
|
||||||
if errCat != nil {
|
if errCat != nil {
|
||||||
log.Println("ERR0001" + errCat.Error())
|
log.Println("ERR0 Categories" + errCat.Error())
|
||||||
|
tx.Rollback()
|
||||||
return errCat
|
return errCat
|
||||||
}
|
}
|
||||||
|
|
||||||
brand, err := gm.FindOrCreateBrand(&tx, product.Brand, categories)
|
brand, err := gm.FindOrCreateBrand(&tx, product.Brand, categories)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
log.Println(err)
|
log.Println("ERR BRAND" + err.Error())
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ type AttributeOption struct {
|
||||||
ID uint `gorm:"primaryKey"`
|
ID uint `gorm:"primaryKey"`
|
||||||
AttributeID uint
|
AttributeID uint
|
||||||
AdminName string
|
AdminName string
|
||||||
Position int
|
SortOrder int `sql:"DEFAULT:NULL" gorm:"default:null"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Attribute struct {
|
type Attribute struct {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue