diff --git a/business/jxcallback/orderman/orderman_ext.go b/business/jxcallback/orderman/orderman_ext.go index 044ef4745..bba87c154 100644 --- a/business/jxcallback/orderman/orderman_ext.go +++ b/business/jxcallback/orderman/orderman_ext.go @@ -698,6 +698,9 @@ func (c *OrderManager) GetStoresOrderSaleInfoNew(ctx *jxcontext.Context, storeID } saleInfoMap[index] = saleInfo } + if v.EarningType == model.EarningTypeQuote { + saleInfo.RealEarningPrice += v.ShopPrice * int64(v.Count) + } saleInfo.ShopPrice += v.ShopPrice * int64(v.Count) saleInfo.VendorPrice += v.VendorPrice * int64(v.Count) saleInfo.SalePrice += v.SalePrice * int64(v.Count) @@ -705,10 +708,12 @@ func (c *OrderManager) GetStoresOrderSaleInfoNew(ctx *jxcontext.Context, storeID if v.VendorOrderID == flagVendorOrderID { if k == 0 { saleInfo.EarningPrice = v.NewEarningPrice + saleInfo.RealEarningPrice += v.NewEarningPrice } } else { flagVendorOrderID = v.VendorOrderID saleInfo.EarningPrice += v.NewEarningPrice + saleInfo.RealEarningPrice += v.NewEarningPrice } universalOrderID := jxutils.ComposeUniversalOrderID(v.VendorOrderID, v.VendorID) diff --git a/business/model/dao/dao_order.go b/business/model/dao/dao_order.go index d2198f926..b85b302af 100644 --- a/business/model/dao/dao_order.go +++ b/business/model/dao/dao_order.go @@ -31,6 +31,8 @@ type StoresOrderSaleInfo struct { DistanceFreightMoney int64 `json:"distanceFreightMoney"` // 商户承担的远距离配送费(当前只有京东到家有值) WaybillTipMoney int64 `json:"waybillTipMoney"` // 京西加的平台配送小费 + + RealEarningPrice int64 `json:"realEarningPrice"` } type OrderSkuWithActualPayPrice struct { @@ -45,6 +47,7 @@ type OrderSkuWithActualPayPrice struct { PayPercentage int `json:"payPercentage"` NewEarningPrice int64 `json:"newEarningPrice"` + EarningType int `json:"earningType"` } type tGoodsAndOrder struct { @@ -373,7 +376,7 @@ func GetStoreOrderSkuList(db *DaoDB, storeIDs []int, finishedAtBegin, finishedAt sql := ` SELECT t1.*, IF(t2.jx_store_id > 0, t2.jx_store_id, t2.store_id) store_id, t2.status, t2.actual_pay_price, t2.distance_freight_money, t2.waybill_tip_money, t2.new_earning_price, - t3.pay_percentage + t3.pay_percentage, t2.earning_type FROM order_sku t1 JOIN goods_order t2 ON t2.vendor_order_id = t1.vendor_order_id AND t2.vendor_id = t1.vendor_id LEFT JOIN store t3 ON t3.id = IF(t2.jx_store_id > 0, t2.jx_store_id, t2.store_id)