- CaculateSkuPrice return UnitPrice when unit is 份

This commit is contained in:
gazebo
2018-09-30 11:13:52 +08:00
parent 11fc8edf6f
commit 834a5b9c24
3 changed files with 9 additions and 5 deletions

View File

@@ -114,7 +114,10 @@ func IntMap2List(intMap map[int]int) []int {
}
// 计算SKU价格unitPrice为一斤的单价specQuality为质量单位为克
func CaculateSkuPrice(unitPrice int, specQuality float32, specUnit string) int {
func CaculateSkuPrice(unitPrice int, specQuality float32, specUnit string, skuNameUnit string) int {
if skuNameUnit == "份" {
return unitPrice
}
if strings.ToLower(specUnit) == "kg" {
specQuality *= 1000
}