- CaculateSkuPric 250, 500
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user