From e184f7a85616729277e0f38909fb4ef4807a6cfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Fri, 19 Mar 2021 15:11:08 +0800 Subject: [PATCH] aa --- business/model/dao/report.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/business/model/dao/report.go b/business/model/dao/report.go index feedc4d0f..dea820b3c 100644 --- a/business/model/dao/report.go +++ b/business/model/dao/report.go @@ -67,7 +67,7 @@ func GetStatisticsReportForOrders(db *DaoDB, storeIDs, vendorIDs []int, fromDate s.total_shop_money, s.pm_subsidy_money, s.earning_price, - s.total_gross_profit, + s.total_gross_profit1 - s.afs_price total_gross_profit, IF(c.jx_brand_fee_factor = 0 AND c.market_add_fee_factor = 0,total_gross_profit,(total_gross_profit*c.jx_brand_fee_factor)/(c.jx_brand_fee_factor+market_add_fee_factor)) com_gross_profit, IF(c.jx_brand_fee_factor = 0 AND c.market_add_fee_factor = 0,0,(total_gross_profit*c.market_add_fee_factor)/(c.jx_brand_fee_factor+market_add_fee_factor)) city_manager_gross_profit, c.status, c.tel1, @@ -97,12 +97,16 @@ func GetStatisticsReportForOrders(db *DaoDB, storeIDs, vendorIDs []int, fromDate SUM(total_shop_money) total_shop_money, SUM(pm_subsidy_money) pm_subsidy_money, SUM(IF(a.earning_type = 1, earning_price, new_earning_price)) earning_price, - SUM(IF(a.order_type = 0,total_shop_money-IF(a.earning_type = 1, earning_price, new_earning_price)-desired_fee-distance_freight_money-waybill_tip_money, 80)) total_gross_profit + SUM(IF(a.order_type = 0,total_shop_money-IF(a.earning_type = 1, earning_price, new_earning_price)-desired_fee-distance_freight_money-waybill_tip_money, 80)) total_gross_profit1, + SUM(d.shop_price) afs_price FROM goods_order a LEFT JOIN waybill b ON IF(a.waybill_vendor_id = -1,a.vendor_order_id,a.vendor_waybill_id) = b.vendor_waybill_id + LEFT JOIN afs_order c ON c.vendor_order_id = a.vendor_order_id + LEFT JOIN order_sku_financial d ON d.afs_order_id = c.afs_order_id AND d.is_afs_order = ? WHERE a.status = ? ` sqlParams := []interface{}{ + model.YES, model.OrderStatusFinished, } if !utils.IsTimeZero(fromDate) && !utils.IsTimeZero(toDate) {