|
@@ -179,23 +179,23 @@ func (ps NewPriceSetting) UnityPrice(num float64, cycleType, subAccount int, dif
|
|
|
case 1: //
|
|
|
if num >= gconv.Float64(pricing.Min) && num < gconv.Float64(pricing.Max) {
|
|
|
if diffPrice != 0 {
|
|
|
- return gconv.Int64(math.Floor(((newPrice+subPrice*gconv.Float64(subAccount))/float64(pricing.Unit) - diffPrice) * float64(num)))
|
|
|
+ return gconv.Int64(math.Floor(((newPrice+subPrice*gconv.Float64(subAccount))/float64(pricing.Unit) - diffPrice) * num))
|
|
|
}
|
|
|
- return gconv.Int64(math.Floor((newPrice + subPrice*gconv.Float64(subAccount)) / (float64(pricing.Unit) / float64(num))))
|
|
|
+ return gconv.Int64(math.Floor((newPrice + subPrice*gconv.Float64(subAccount)) / (float64(pricing.Unit) / num)))
|
|
|
}
|
|
|
case 2:
|
|
|
if num/12 >= gconv.Float64(pricing.Min) && num/12 < float64(pricing.Max) {
|
|
|
if diffPrice != 0 {
|
|
|
- return gconv.Int64(math.Floor(((newPrice+subPrice*gconv.Float64(subAccount))/float64(pricing.Unit) - diffPrice) * float64(num)))
|
|
|
+ return gconv.Int64(math.Floor(((newPrice+subPrice*gconv.Float64(subAccount))/float64(pricing.Unit) - diffPrice) * num))
|
|
|
}
|
|
|
- return gconv.Int64(math.Floor((newPrice + subPrice*gconv.Float64(subAccount)) / (float64(pricing.Unit) / float64(num))))
|
|
|
+ return gconv.Int64(math.Floor((newPrice + subPrice*gconv.Float64(subAccount)) / (float64(pricing.Unit) / num)))
|
|
|
}
|
|
|
case 3:
|
|
|
if float64(num)/3 >= gconv.Float64(pricing.Min) && float64(num)/3 < float64(pricing.Max) {
|
|
|
if diffPrice != 0 {
|
|
|
- return gconv.Int64(math.Floor(((newPrice+subPrice*gconv.Float64(subAccount))/float64(pricing.Unit) - diffPrice) * float64(num)))
|
|
|
+ return gconv.Int64(math.Floor(((newPrice+subPrice*gconv.Float64(subAccount))/float64(pricing.Unit) - diffPrice) * num))
|
|
|
}
|
|
|
- return gconv.Int64(math.Floor((newPrice + subPrice*gconv.Float64(subAccount)) / (float64(pricing.Unit) / float64(num))))
|
|
|
+ return gconv.Int64(math.Floor((newPrice + subPrice*gconv.Float64(subAccount)) / (float64(pricing.Unit) / num)))
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -216,16 +216,16 @@ func (ps NewPriceSetting) UnityPrice(num float64, cycleType, subAccount int, dif
|
|
|
case 1: //
|
|
|
if num*12 >= gconv.Float64(pricing.Min) && num*12 < gconv.Float64(pricing.Max) {
|
|
|
if diffPrice != 0 {
|
|
|
- return gconv.Int64(math.Floor(((newPrice+subPrice*gconv.Float64(subAccount))/float64(pricing.Unit) - diffPrice) * float64(num*12)))
|
|
|
+ return gconv.Int64(math.Floor(((newPrice+subPrice*gconv.Float64(subAccount))/float64(pricing.Unit) - diffPrice) * num * 12))
|
|
|
}
|
|
|
- return gconv.Int64(math.Floor((newPrice + subPrice*gconv.Float64(subAccount)) / (float64(pricing.Unit) / float64(num*12))))
|
|
|
+ return gconv.Int64(math.Floor((newPrice + subPrice*gconv.Float64(subAccount)) / (float64(pricing.Unit) / num / 12)))
|
|
|
}
|
|
|
case 2:
|
|
|
if num >= gconv.Float64(pricing.Min) && num < float64(pricing.Max) {
|
|
|
if diffPrice != 0 {
|
|
|
- return gconv.Int64(math.Floor(((newPrice+subPrice*gconv.Float64(subAccount))/float64(pricing.Unit) - diffPrice) * float64(num*12)))
|
|
|
+ return gconv.Int64(math.Floor(((newPrice+subPrice*gconv.Float64(subAccount))/float64(pricing.Unit) - diffPrice) * num * 12))
|
|
|
}
|
|
|
- return gconv.Int64(math.Floor((newPrice + subPrice*gconv.Float64(subAccount)) / (float64(pricing.Unit) / float64(num*12))))
|
|
|
+ return gconv.Int64(math.Floor((newPrice + subPrice*gconv.Float64(subAccount)) / (float64(pricing.Unit) / num / 12)))
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -246,23 +246,23 @@ func (ps NewPriceSetting) UnityPrice(num float64, cycleType, subAccount int, dif
|
|
|
case 1:
|
|
|
if num*3 >= gconv.Float64(pricing.Min) && num*3 < gconv.Float64(pricing.Max) {
|
|
|
if diffPrice != 0 {
|
|
|
- return gconv.Int64(math.Floor(((newPrice+subPrice*gconv.Float64(subAccount))/float64(pricing.Unit) - diffPrice) * float64(num*3)))
|
|
|
+ return gconv.Int64(math.Floor(((newPrice+subPrice*gconv.Float64(subAccount))/float64(pricing.Unit) - diffPrice) * num * 3))
|
|
|
}
|
|
|
- return gconv.Int64(math.Floor((newPrice + subPrice*gconv.Float64(subAccount)) / (float64(pricing.Unit) / float64(num*3))))
|
|
|
+ return gconv.Int64(math.Floor((newPrice + subPrice*gconv.Float64(subAccount)) / (float64(pricing.Unit) / num / 3)))
|
|
|
}
|
|
|
case 2: //
|
|
|
if gconv.Float64(num/4) >= gconv.Float64(pricing.Min) && gconv.Float64(num/4) < gconv.Float64(pricing.Max) {
|
|
|
if diffPrice != 0 {
|
|
|
- return gconv.Int64(math.Floor(((newPrice+subPrice*gconv.Float64(subAccount))/float64(pricing.Unit) - diffPrice) * float64(num*3)))
|
|
|
+ return gconv.Int64(math.Floor(((newPrice+subPrice*gconv.Float64(subAccount))/float64(pricing.Unit) - diffPrice) * num * 3))
|
|
|
}
|
|
|
- return gconv.Int64(math.Floor((newPrice + subPrice*gconv.Float64(subAccount)) / (float64(pricing.Unit) / float64(num*3))))
|
|
|
+ return gconv.Int64(math.Floor((newPrice + subPrice*gconv.Float64(subAccount)) / (float64(pricing.Unit) / num / 3)))
|
|
|
}
|
|
|
case 3:
|
|
|
if num >= gconv.Float64(pricing.Min) && num < float64(pricing.Max) {
|
|
|
if diffPrice != 0 {
|
|
|
- return gconv.Int64(math.Floor(((newPrice+subPrice*gconv.Float64(subAccount))/float64(pricing.Unit) - diffPrice) * float64(num*3)))
|
|
|
+ return gconv.Int64(math.Floor(((newPrice+subPrice*gconv.Float64(subAccount))/float64(pricing.Unit) - diffPrice) * num * 3))
|
|
|
}
|
|
|
- return gconv.Int64(math.Floor((newPrice + subPrice*gconv.Float64(subAccount)) / (float64(pricing.Unit) / float64(num*3))))
|
|
|
+ return gconv.Int64(math.Floor((newPrice + subPrice*gconv.Float64(subAccount)) / (float64(pricing.Unit) / num / 3)))
|
|
|
}
|
|
|
}
|
|
|
}
|