cinsiyet eklenior

This commit is contained in:
merdan 2022-09-27 18:53:17 +05:00
parent 144db0a55b
commit 36a65611e3
3 changed files with 21 additions and 0 deletions

View File

@ -227,6 +227,8 @@ func getCats(db *gorm.DB, catIDs []int) ([]gm.Category, string, error) {
} }
} }
log.Println(keywords)
return categories, keywords, nil return categories, keywords, nil
} }
@ -245,6 +247,8 @@ func ImportProduct(product models.Product, db *gorm.DB) error {
return errCat return errCat
} }
return tx.Rollback().Error
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()

1
controllers/ImportV2.go Normal file
View File

@ -0,0 +1 @@
package controller

View File

@ -0,0 +1,16 @@
package repositories
import (
gm "db_service/gorm_models"
"gorm.io/gorm"
)
type Importer struct {
mainCategories []gm.Category
baza *gorm.DB
families []gm.AttributeFamily
}
func ImporterInstance() Importer {
return Importer{}
}