计算earningprice

This commit is contained in:
苏尹岚
2020-05-19 17:54:13 +08:00
parent 48d6ed401c
commit f92076a264
2 changed files with 14 additions and 4 deletions

View File

@@ -392,7 +392,11 @@ func (c *OrderManager) updateOrderSkuOtherInfo(order *model.GoodsOrder, db *dao.
if v.VendorPrice == v.SalePrice {
var earningPrice = 0
if v.ShopPrice < v.SalePrice {
earningPrice = int(utils.Float64TwoInt64(math.Round(utils.Int2Float64(int(v.ShopPrice)) * utils.Int2Float64(storePayPercentage) / 100)))
if v.ShopPrice == 0 {
earningPrice = int(utils.Float64TwoInt64(math.Round(utils.Int2Float64(int(v.SalePrice)) * utils.Int2Float64(storePayPercentage) / 100)))
} else {
earningPrice = int(utils.Float64TwoInt64(math.Round(utils.Int2Float64(int(v.ShopPrice)) * utils.Int2Float64(storePayPercentage) / 100)))
}
} else {
earningPrice = int(utils.Float64TwoInt64(math.Round(utils.Int2Float64(int(v.SalePrice)) * utils.Int2Float64(storePayPercentage) / 100)))
}