categories update4
This commit is contained in:
parent
5e8ec82e44
commit
f7e0a9c8fb
|
|
@ -339,7 +339,7 @@ func (importer *Importer) importVariant(product models.Product) (*gm.Product, er
|
||||||
return nil, err3
|
return nil, err3
|
||||||
}
|
}
|
||||||
|
|
||||||
return &barProduct,nil
|
return &barProduct,tx.Commit().Error;
|
||||||
}else{
|
}else{
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
@ -509,9 +509,9 @@ func (importer *Importer) updateVariant(product models.Product) (*gm.Product, er
|
||||||
var flat gm.ProductFlat
|
var flat gm.ProductFlat
|
||||||
err := importer.baza.Preload("Product").Preload("Variants").First(&flat, "sku = ?", product.ProductNumber).Error
|
err := importer.baza.Preload("Product").Preload("Variants").First(&flat, "sku = ?", product.ProductNumber).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
//if errors.Is(err,gorm.ErrRecordNotFound) {
|
if errors.Is(err,gorm.ErrRecordNotFound) {
|
||||||
// return importer.importVariant(product)
|
return importer.importVariant(product)
|
||||||
//}
|
}
|
||||||
//todo not found bolsa create etmeli
|
//todo not found bolsa create etmeli
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue