seller id deadlock and delete elapsed time
This commit is contained in:
parent
1280c05303
commit
3fc2d749b2
|
|
@ -863,7 +863,7 @@ func UpdateProduct(product models.Product, db *gorm.DB, productFlat gm.ProductFl
|
|||
variantFlat.MinPrice = prices.DiscountedPrice.Value
|
||||
variantFlat.MaxPrice = prices.OriginalPrice.Value
|
||||
|
||||
errVar := db.Save(&variantFlat).Error
|
||||
errVar := db.Omit("CreatedAt").Save(&variantFlat).Error
|
||||
|
||||
if errVar != nil {
|
||||
log.Println(errVar.Error())
|
||||
|
|
@ -874,7 +874,7 @@ func UpdateProduct(product models.Product, db *gorm.DB, productFlat gm.ProductFl
|
|||
variantFlat.MinPrice = prices.DiscountedPrice.Value
|
||||
variantFlat.MaxPrice = prices.DiscountedPrice.Value
|
||||
|
||||
errVar := db.Exec("Update product_flat set price = ? special_price = NULL where id = ?", prices.DiscountedPrice.Value, variantFlat.ID).Error
|
||||
errVar := db.Exec("Update product_flat set price = ?,min_price=?, max_price=? special_price = NULL where id = ?", prices.DiscountedPrice.Value, variantFlat.MinPrice, variantFlat.MaxPrice, variantFlat.ID).Error
|
||||
|
||||
if errVar != nil {
|
||||
log.Println(errVar.Error())
|
||||
|
|
@ -918,15 +918,16 @@ func UpdateProduct(product models.Product, db *gorm.DB, productFlat gm.ProductFl
|
|||
variantFlat.MinPrice = prices.DiscountedPrice.Value
|
||||
variantFlat.MaxPrice = prices.OriginalPrice.Value
|
||||
|
||||
errVar := db.Save(&variantFlat).Error
|
||||
errVar := db.Omit("CreatedAt").Save(&variantFlat).Error
|
||||
|
||||
if errVar != nil {
|
||||
log.Println(errVar.Error())
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
errVar := db.Exec("Update product_flat set price = ? special_price = NULL where id = ?", prices.DiscountedPrice.Value, variantFlat.ID).Error
|
||||
variantFlat.MinPrice = prices.DiscountedPrice.Value
|
||||
variantFlat.MaxPrice = prices.DiscountedPrice.Value
|
||||
errVar := db.Exec("Update product_flat set price = ?,min_price=?, max_price=? special_price = NULL where id = ?", prices.DiscountedPrice.Value, variantFlat.MinPrice, variantFlat.MaxPrice, variantFlat.ID).Error
|
||||
|
||||
if errVar != nil {
|
||||
log.Println(errVar.Error())
|
||||
|
|
@ -976,15 +977,17 @@ func UpdateProduct(product models.Product, db *gorm.DB, productFlat gm.ProductFl
|
|||
variantFlat.MinPrice = prices.DiscountedPrice.Value
|
||||
variantFlat.MaxPrice = prices.OriginalPrice.Value
|
||||
|
||||
errVar := db.Save(&variantFlat).Error
|
||||
errVar := db.Omit("CreatedAt").Save(&variantFlat).Error
|
||||
|
||||
if errVar != nil {
|
||||
log.Println(errVar.Error())
|
||||
}
|
||||
|
||||
} else {
|
||||
variantFlat.MinPrice = prices.DiscountedPrice.Value
|
||||
variantFlat.MaxPrice = prices.DiscountedPrice.Value
|
||||
|
||||
errVar := db.Exec("Update product_flat set price = ? special_price = NULL where id = ?", prices.DiscountedPrice.Value, variantFlat.ID).Error
|
||||
errVar := db.Exec("Update product_flat set price = ?,min_price=?, max_price=? special_price = NULL where id = ?", prices.DiscountedPrice.Value, variantFlat.MinPrice, variantFlat.MaxPrice, variantFlat.ID).Error
|
||||
|
||||
if errVar != nil {
|
||||
log.Println(errVar.Error())
|
||||
|
|
|
|||
Loading…
Reference in New Issue