This commit is contained in:
suyl
2021-07-05 18:48:41 +08:00
parent 273072882c
commit a593d57a33

View File

@@ -6,6 +6,7 @@ import (
"encoding/base64"
"errors"
"fmt"
beego "github.com/astaxie/beego/server/web"
"image"
"image/png"
"io/ioutil"
@@ -503,17 +504,18 @@ func GetVendorName(vendorID int) (vendorName string) {
}
func CaculateSkuEarningPrice(shopPrice, salePrice int64, storePayPercentage int) (earningPrice int64) {
//TODO 2021-07-05 菜市和果园一样,取低的
//if beego.BConfig.RunMode == "jxgy" {
//TODO 2021-07-05 16:50菜市和果园一样,取低的
//TODO 2021-07-05 18:48 还是改回来
if beego.BConfig.RunMode == "jxgy" {
earningPrice = salePrice
if salePrice != 0 {
if shopPrice > 0 && shopPrice < earningPrice {
earningPrice = shopPrice
}
}
//} else {
// earningPrice = shopPrice
//}
} else {
earningPrice = shopPrice
}
storePayPercentage = ConstrainPayPercentage(storePayPercentage)
if storePayPercentage <= 0 {
storePayPercentage = model.DefaultEarningPricePercentage