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 &barProduct,nil
|
||||
return &barProduct,tx.Commit().Error;
|
||||
}else{
|
||||
tx.Rollback()
|
||||
return nil, err
|
||||
|
|
@ -509,9 +509,9 @@ func (importer *Importer) updateVariant(product models.Product) (*gm.Product, er
|
|||
var flat gm.ProductFlat
|
||||
err := importer.baza.Preload("Product").Preload("Variants").First(&flat, "sku = ?", product.ProductNumber).Error
|
||||
if err != nil {
|
||||
//if errors.Is(err,gorm.ErrRecordNotFound) {
|
||||
// return importer.importVariant(product)
|
||||
//}
|
||||
if errors.Is(err,gorm.ErrRecordNotFound) {
|
||||
return importer.importVariant(product)
|
||||
}
|
||||
//todo not found bolsa create etmeli
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue