门店营业数据
This commit is contained in:
@@ -698,6 +698,9 @@ func (c *OrderManager) GetStoresOrderSaleInfoNew(ctx *jxcontext.Context, storeID
|
|||||||
}
|
}
|
||||||
saleInfoMap[index] = saleInfo
|
saleInfoMap[index] = saleInfo
|
||||||
}
|
}
|
||||||
|
if v.EarningType == model.EarningTypeQuote {
|
||||||
|
saleInfo.RealEarningPrice += v.ShopPrice * int64(v.Count)
|
||||||
|
}
|
||||||
saleInfo.ShopPrice += v.ShopPrice * int64(v.Count)
|
saleInfo.ShopPrice += v.ShopPrice * int64(v.Count)
|
||||||
saleInfo.VendorPrice += v.VendorPrice * int64(v.Count)
|
saleInfo.VendorPrice += v.VendorPrice * int64(v.Count)
|
||||||
saleInfo.SalePrice += v.SalePrice * 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 v.VendorOrderID == flagVendorOrderID {
|
||||||
if k == 0 {
|
if k == 0 {
|
||||||
saleInfo.EarningPrice = v.NewEarningPrice
|
saleInfo.EarningPrice = v.NewEarningPrice
|
||||||
|
saleInfo.RealEarningPrice += v.NewEarningPrice
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
flagVendorOrderID = v.VendorOrderID
|
flagVendorOrderID = v.VendorOrderID
|
||||||
saleInfo.EarningPrice += v.NewEarningPrice
|
saleInfo.EarningPrice += v.NewEarningPrice
|
||||||
|
saleInfo.RealEarningPrice += v.NewEarningPrice
|
||||||
}
|
}
|
||||||
|
|
||||||
universalOrderID := jxutils.ComposeUniversalOrderID(v.VendorOrderID, v.VendorID)
|
universalOrderID := jxutils.ComposeUniversalOrderID(v.VendorOrderID, v.VendorID)
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ type StoresOrderSaleInfo struct {
|
|||||||
|
|
||||||
DistanceFreightMoney int64 `json:"distanceFreightMoney"` // 商户承担的远距离配送费(当前只有京东到家有值)
|
DistanceFreightMoney int64 `json:"distanceFreightMoney"` // 商户承担的远距离配送费(当前只有京东到家有值)
|
||||||
WaybillTipMoney int64 `json:"waybillTipMoney"` // 京西加的平台配送小费
|
WaybillTipMoney int64 `json:"waybillTipMoney"` // 京西加的平台配送小费
|
||||||
|
|
||||||
|
RealEarningPrice int64 `json:"realEarningPrice"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type OrderSkuWithActualPayPrice struct {
|
type OrderSkuWithActualPayPrice struct {
|
||||||
@@ -45,6 +47,7 @@ type OrderSkuWithActualPayPrice struct {
|
|||||||
|
|
||||||
PayPercentage int `json:"payPercentage"`
|
PayPercentage int `json:"payPercentage"`
|
||||||
NewEarningPrice int64 `json:"newEarningPrice"`
|
NewEarningPrice int64 `json:"newEarningPrice"`
|
||||||
|
EarningType int `json:"earningType"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type tGoodsAndOrder struct {
|
type tGoodsAndOrder struct {
|
||||||
@@ -373,7 +376,7 @@ func GetStoreOrderSkuList(db *DaoDB, storeIDs []int, finishedAtBegin, finishedAt
|
|||||||
sql := `
|
sql := `
|
||||||
SELECT t1.*,
|
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,
|
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
|
FROM order_sku t1
|
||||||
JOIN goods_order t2 ON t2.vendor_order_id = t1.vendor_order_id AND t2.vendor_id = t1.vendor_id
|
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)
|
LEFT JOIN store t3 ON t3.id = IF(t2.jx_store_id > 0, t2.jx_store_id, t2.store_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user