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()
|
||||
|
||||
categories, keywords, errCat := getCats(&tx, product.Categories)
|
||||
log.Println(categories)
|
||||
if errCat != nil {
|
||||
log.Println("ERR0001" + errCat.Error())
|
||||
log.Println("ERR0 Categories" + errCat.Error())
|
||||
tx.Rollback()
|
||||
return errCat
|
||||
}
|
||||
|
||||
brand, err := gm.FindOrCreateBrand(&tx, product.Brand, categories)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
log.Println(err)
|
||||
log.Println("ERR BRAND" + err.Error())
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ type AttributeOption struct {
|
|||
ID uint `gorm:"primaryKey"`
|
||||
AttributeID uint
|
||||
AdminName string
|
||||
Position int
|
||||
SortOrder int `sql:"DEFAULT:NULL" gorm:"default:null"`
|
||||
}
|
||||
|
||||
type Attribute struct {
|
||||
|
|
|
|||
Loading…
Reference in New Issue