From 190306d902940945ce6bca1062e0ca2b062f1049 Mon Sep 17 00:00:00 2001 From: merdan Date: Wed, 21 Sep 2022 13:04:46 +0500 Subject: [PATCH] seller id deadlock and delete elapsed time --- controllers/ImportController.go | 2 +- gorm_models/product.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/ImportController.go b/controllers/ImportController.go index f5db534..63068ea 100644 --- a/controllers/ImportController.go +++ b/controllers/ImportController.go @@ -390,7 +390,7 @@ func ImportProduct(product models.Product, db *gorm.DB) error { flatVariant.MaxPrice = sizeVariant.Price.DiscountedPrice.Value } - if mainProductFlat.MinPrice > flatVariant.MinPrice || mainProductFlat.MinPrice == 0 { + if mainProductFlat.MinPrice > flatVariant.MinPrice || mainProductFlat.MinPrice == 0.0 { mainProductFlat.MinPrice = flatVariant.MinPrice } diff --git a/gorm_models/product.go b/gorm_models/product.go index dce2117..2ec2bcc 100644 --- a/gorm_models/product.go +++ b/gorm_models/product.go @@ -37,7 +37,7 @@ type ProductFlat struct { Price float64 `gorm:"type:decimal(12,4)"` MinPrice float64 `gorm:"type:decimal(12,4)"` MaxPrice float64 `gorm:"type:decimal(12,4)"` - SpecialPrice float64 `gorm:"type:decimal(12,4)"` + SpecialPrice float64 `sql:"DEFAULT:NULL" gorm:"type:decimal(12,4);default:null"` UrlKey string `sql:"DEFAULT:NULL" gorm:"default:null"` ShortDescription string `sql:"DEFAULT:NULL" gorm:"default:null"` Description string `sql:"DEFAULT:NULL" gorm:"default:null"`