18 lines
441 B
Go
Raw Normal View History

2023-06-13 17:47:48 +08:00
package step_price
2023-09-26 11:40:27 +08:00
// 旧的返回厘(即将废弃)
2023-06-27 18:35:26 +08:00
func GetCentStepPrice(minBuyNum int, stepNum []int, stepPrice []int) int64 {
if minBuyNum > stepNum[len(stepNum)-1] {
return int64(stepPrice[len(stepPrice)-1])
}
for k, v := range stepNum {
if minBuyNum <= v {
if k <= (len(stepPrice) - 1) {
return int64(stepPrice[k])
}
return int64(stepPrice[len(stepPrice)-1])
}
}
return int64(stepPrice[len(stepPrice)-1])
}