This commit is contained in:
苏尹岚
2021-03-19 18:09:23 +08:00
parent 3a8c83434c
commit 2d3cecd1da

View File

@@ -86,8 +86,8 @@ func GetStatisticsReportForOrders(db *DaoDB, storeIDs, vendorIDs []int, fromDate
(
SELECT ss.*,
ss.earning_price1 - IFNULL(ss.afs_shop_price,0) earning_price,
ss.total_gross_profit1 - IFNULL(ss.afs_shop_price,0) total_gross_profit,
ss.total_shop_money1 - IFNULL(ss.afs_total_money,0) total_shop_money
ss.total_shop_money1 - IFNULL(ss.afs_total_money,0) total_shop_money,
ss.total_gross_profit1 + IFNULL(ss.afs_shop_price,0) - IFNULL(ss.afs_total_money,0)-ss.order_counts*0.8*100 total_gross_profit
FROM (
SELECT
IF(a.jx_store_id <> 0,a.jx_store_id,a.store_id) store_id,
@@ -102,7 +102,7 @@ func GetStatisticsReportForOrders(db *DaoDB, storeIDs, vendorIDs []int, fromDate
SUM(a.total_shop_money) total_shop_money1,
SUM(a.pm_subsidy_money) pm_subsidy_money,
SUM(IF(a.earning_type = 1, a.earning_price, a.new_earning_price)) earning_price1,
SUM(IF(a.order_type = 0,a.total_shop_money-IF(a.earning_type = 1, a.earning_price, a.new_earning_price)-b.desired_fee-a.distance_freight_money-a.waybill_tip_money, 80)) total_gross_profit1,
SUM(a.total_shop_money-IF(a.earning_type = 1, a.earning_price, a.new_earning_price)-b.desired_fee) total_gross_profit1,
SUM(d.shop_price) afs_shop_price,
SUM(d.refund_money_by_cal) afs_total_money
FROM goods_order a