This commit is contained in:
苏尹岚
2021-03-19 14:01:38 +08:00
parent 89306f76b6
commit b1f87f4334

View File

@@ -97,7 +97,7 @@ func GetStatisticsReportForOrders(db *DaoDB, storeIDs []int, fromDate time.Time,
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_tpye = 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_profit
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
WHERE a.status = ?