订单结算价,若数量大于1且结算价不为0,需要进行拆分

This commit is contained in:
苏尹岚
2020-05-06 14:50:52 +08:00
parent 8249a9abba
commit 726e5c0686
2 changed files with 14 additions and 2 deletions

View File

@@ -364,6 +364,18 @@ func (c *OrderManager) updateOrderSkuOtherInfo(order *model.GoodsOrder, db *dao.
salePrice = 0
}
v.EarningPrice = jxutils.CaculateSkuEarningPrice(v.ShopPrice, salePrice, storePayPercentage)
//重复购买有结算价的商品需要拆分第一个商品按结算价后面的商品按shopprice 或者 saleprice然后把原来的商品信息删了
if v.Count > 1 && v.EarningPrice != 0 {
sku := v
sku.Count = v.Count - 1
v.Count = 1
if v.ShopPrice < v.SalePrice {
sku.EarningPrice = v.ShopPrice
} else {
sku.EarningPrice = v.SalePrice
}
orderSkus = append(orderSkus, sku)
}
}
// 直营店始终按比例结算,不考虑活动与结算表
if changePriceType != model.StoreChangePriceTypeManagedStore {

View File

@@ -430,9 +430,9 @@ func (c *OrderManager) ExportOrders(ctx *jxcontext.Context, fromDateStr, toDateS
"waybillCreatedAt",
"waybillFinishedAt",
"status2",
"skuInfo",
"waybillTipMoney",
"skuInfo2",
"waybillTipMoney",
// "skuInfo2",
},
}
excelBin = excel.Obj2Excel([]*excel.Obj2ExcelSheetConfig{excelConf})