This commit is contained in:
suyl
2021-05-11 11:08:06 +08:00
parent 1dd5b592a8
commit 26940b3a12
3 changed files with 119 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ import (
"crypto/md5"
"errors"
"fmt"
beego "github.com/astaxie/beego/server/web"
"math"
"strings"
"time"
@@ -1824,7 +1825,13 @@ func RefreshOrderSkuInfo(ctx *jxcontext.Context, vendorOrderID string, vendorID,
}
storeSku := storeSkus[0]
//if v.ShopPrice == v.EarningPrice {
v.EarningPrice = int64(math.Round(float64(storeSku.Price) * float64(order.OrderPayPercentage) / 100))
if beego.BConfig.RunMode == "jxgy" {
if v.SalePrice > v.ShopPrice {
v.EarningPrice = int64(math.Round(float64(storeSku.Price) * float64(order.OrderPayPercentage) / 100))
}
} else {
v.EarningPrice = int64(math.Round(float64(storeSku.Price) * float64(order.OrderPayPercentage) / 100))
}
//}
v.ShopPrice = int64(storeSku.Price)
dao.UpdateEntity(db, v, "ShopPrice", "EarningPrice")