This commit is contained in:
邹宗楠
2023-02-13 18:09:56 +08:00
parent 75e5eec7f0
commit eab598efba

View File

@@ -1097,13 +1097,14 @@ func UpdateSkuName(ctx *jxcontext.Context, nameID int, payload map[string]interf
globals.SugarLogger.Debugf("errr %v", err)
var skuPrice int64 = 0
if payload["unit"] == "份" { // 商品规格等于份的时候,标准重量保持为500g
skuPrice = int64(skuInfo.SpecQuality/500) * nowPrice
skuPrice = int64(float64(skuInfo.SpecQuality) / float64(500) * float64(nowPrice))
} else {
skuPrice = nowPrice
}
sql := ` UPDATE store_sku_bind s SET s.price = ? WHERE s.sku_id = ? AND s.deleted_at = ?`
param := []interface{}{skuPrice, skuInfo.Id, utils.DefaultTimeValue}
globals.SugarLogger.Debugf("=================param %s", utils.Format4Output(param, false))
_, err = dao.ExecuteSQL(db, sql, param...)
globals.SugarLogger.Debugf("=================err %v", err)
}