同步平台价从向上变成四舍五入

This commit is contained in:
苏尹岚
2020-03-19 14:42:39 +08:00
parent ac430e3359
commit cb9c465e10
2 changed files with 7 additions and 8 deletions

View File

@@ -271,7 +271,7 @@ func CaculateSkuActVendorPrice(price, percentage, priceAdd int) (vendorPrice int
func CaculateSkuVendorPrice(price, percentage, priceAdd int) (vendorPrice int) {
percentage = ConstrainPricePercentage(percentage)
vendorPrice = int(math.Round(float64(price*percentage)/100)) + priceAdd
vendorPrice = int(math.Ceil(float64(vendorPrice)/10) * 10)
vendorPrice = int(math.Round(float64(vendorPrice)/10) * 10)
if vendorPrice < 1 {
vendorPrice = 1
}

View File

@@ -3,9 +3,8 @@ package api
import (
"time"
"git.rosy.net.cn/baseapi/platformapi/yinbaoapi"
"git.rosy.net.cn/baseapi/platformapi/jdeclpapi"
"git.rosy.net.cn/baseapi/platformapi/yinbaoapi"
"git.rosy.net.cn/baseapi/platformapi/tonglianpayapi"
@@ -160,11 +159,11 @@ func Init() {
Ebai2API = nil
}
if !beego.AppConfig.DefaultBool("disableYb", false) {
YinBaoAPI = yinbaoapi.New(beego.AppConfig.String("yinbaoAppKey"), beego.AppConfig.String("yinbaoAppID"))
} else {
YinBaoAPI = nil
}
// if !beego.AppConfig.DefaultBool("disableYb", false) {
// YinBaoAPI = yinbaoapi.New(beego.AppConfig.String("yinbaoAppKey"), beego.AppConfig.String("yinbaoAppID"))
// } else {
// YinBaoAPI = nil
// }
if !beego.AppConfig.DefaultBool("disableMtps", false) {
MtpsAPI = mtpsapi.New(beego.AppConfig.String("mtpsAppKey"), beego.AppConfig.String("mtpsSecret"))