diff --git a/business/jxstore/cms/cms.go b/business/jxstore/cms/cms.go index 14eb1218a..453d96738 100644 --- a/business/jxstore/cms/cms.go +++ b/business/jxstore/cms/cms.go @@ -90,7 +90,7 @@ func GetPlaces(ctx *jxcontext.Context, keyword string, includeDisabled bool, par sqlParams = append(sqlParams, params["level"]) } sql += " ORDER BY t1.level, t1.name" - globals.SugarLogger.Debug(sql) + // globals.SugarLogger.Debug(sql) places := []*model.Place{} return places, dao.GetRows(nil, &places, sql, sqlParams) } diff --git a/business/jxutils/jxutils_cms.go b/business/jxutils/jxutils_cms.go index 5c88309a3..ae4d93efe 100644 --- a/business/jxutils/jxutils_cms.go +++ b/business/jxutils/jxutils_cms.go @@ -119,10 +119,17 @@ func CaculateSkuPrice(unitPrice int, specQuality float32, specUnit string, skuNa if skuNameUnit != "份" { return unitPrice } - if strings.ToLower(specUnit) == "kg" { + lowerSpecUnit := strings.ToLower(specUnit) + if lowerSpecUnit == "kg" || lowerSpecUnit == "l" { specQuality *= 1000 } - return int(math.Round(float64(float32(unitPrice) * specQuality / 500))) + price := int(math.Round(float64(float32(unitPrice) * specQuality / 500))) + if specQuality < 250 { + price = price * 120 / 100 + } else if specQuality < 500 { + price = price * 110 / 100 + } + return price } func GetSliceLen(list interface{}) int {