This commit is contained in:
suyl
2021-06-23 16:31:11 +08:00
parent 4f07f32834
commit 2df3e2d6c8
2 changed files with 7 additions and 11 deletions

View File

@@ -371,17 +371,13 @@ func (c *OrderManager) GetOrders(ctx *jxcontext.Context, isIncludeFake bool, fro
sqlParams := []interface{}{model.AfsOrderStatusFinished, order.VendorOrderID,
model.YES}
if err = dao.GetRow(db, &afsOrder, sql, sqlParams); err == nil && afsOrder != nil {
totalShopMoney := order.TotalShopMoney
if afsOrder.AfsTotalShopMoney != 0 {
totalShopMoney = afsOrder.AfsTotalShopMoney
}
//if afsOrder.AfsTotalShopMoney != 0 {
//报价,要减去商品的京西价
if order.EarningType == model.EarningTypeQuote {
order.JxIncome = totalShopMoney - order.EarningPrice - order.DesiredFee + (afsOrder.ShopPrice * int64(order.OrderPayPercentage/100))
} else {
order.JxIncome = totalShopMoney * int64(order.OrderPayPercentage/2/100)
//}
//报价,要减去商品的京西价
if order.EarningType == model.EarningTypeQuote {
order.JxIncome = afsOrder.AfsTotalShopMoney - order.EarningPrice - order.DesiredFee + (afsOrder.ShopPrice * int64(order.OrderPayPercentage/100))
} else {
order.JxIncome = afsOrder.AfsTotalShopMoney * int64(order.OrderPayPercentage/2/100)
}
}
}
return retVal, err

View File

@@ -781,7 +781,7 @@ func GetOrders(db *DaoDB, ids []int64, isIncludeSku, isIncludeFake bool, fromDat
t5.operator_phone, t5.operator_phone2, t5.operator_phone3, tu1.name operator_name, tu2.name operator_name2, tu3.name operator_name3,
t6.vendor_pay_percentage,
city.name city_name, district.name district_name
-- ROUND(IF(t1.earning_type = 1, t1.total_shop_money-t1.earning_price-IFNULL(t2.desired_fee,0), t1.total_shop_money *(t1.order_pay_percentage/2)/100)) jx_income`, model.DefaultEarningPricePercentage)
ROUND(IF(t1.earning_type = 1, t1.total_shop_money-t1.earning_price-IFNULL(t2.desired_fee,0), t1.total_shop_money *(t1.order_pay_percentage/2)/100)) jx_income`, model.DefaultEarningPricePercentage)
if isIncludeSku {
sql += `,
IF(t3.jx_sku_id > 0, t3.jx_sku_id, t3.sku_id) sku_id,