This commit is contained in:
苏尹岚
2021-03-05 17:02:14 +08:00
parent ad40d2e0b2
commit 71f4d08d68
3 changed files with 21 additions and 31 deletions

View File

@@ -545,35 +545,25 @@ func (c *OrderManager) updateOrderSkuOtherInfo(order *model.GoodsOrder, db *dao.
//TODO 京东美团的订单,做活动的商品之前就会拆分出来,所以只做更新,饿百暂时不管, 2020-05-07
//TODO 不根据商品是否拆分直接根据该商品做了活动并且他的vendorPrice 和 salePrice 相等,就按新规则结算, 2020-05-11
//TODO 现在不判断商品做没做活动只要vendorPrice和salePrice不等就默认为做了活动不做活动的商品就按新规则结算2020-05-18
if order.VendorID == model.VendorIDJD || order.VendorID == model.VendorIDMTWM {
for _, v := range orderSkus {
if v.EarningPrice > 0 {
// var storeID int
// if order.StoreID == 0 {
// storeID = order.JxStoreID
// } else {
// storeID = order.StoreID
// }
// result, err := dao.GetEffectiveActStoreSkuInfo2(db, 0, []int{order.VendorID}, []int{model.ActSkuSecKill, model.ActSkuDirectDown}, []int{storeID}, []int{v.SkuID}, order.OrderCreatedAt, order.OrderCreatedAt)
// if (len(result) > 0 && err == nil) || v.IsVendorAct == model.YES {
if v.VendorPrice == v.SalePrice {
var earningPrice = 0
if v.ShopPrice < v.SalePrice {
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)))
}
v.EarningPrice = int64(earningPrice)
// v.StoreSubID = 0
}
// }
}
}
}
// if order.VendorID == model.VendorIDJD || order.VendorID == model.VendorIDMTWM {
// for _, v := range orderSkus {
// if v.EarningPrice > 0 {
// if v.VendorPrice == v.SalePrice {
// var earningPrice = 0
// if v.ShopPrice < v.SalePrice {
// 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)))
// }
// v.EarningPrice = int64(earningPrice)
// }
// }
// }
// }
}
return nil
}

View File

@@ -77,7 +77,7 @@ func getOrderDetailBrief(order *model.GoodsOrder) (brief string) {
if order.EarningType == model.EarningTypePoints {
price = order.ActualPayPrice
} else {
price = order.ShopPrice
price = order.EarningPrice
}
}
sb.WriteString(jxutils.IntPrice2StandardString(price))

View File

@@ -190,7 +190,7 @@ func getOrderDetailBrief(order *model.GoodsOrder) (brief string) {
if order.EarningType == model.EarningTypePoints {
price = order.ActualPayPrice
} else {
price = order.ShopPrice
price = order.EarningPrice
}
}
sb.WriteString(jxutils.IntPrice2StandardString(price))