aa
This commit is contained in:
@@ -87,17 +87,17 @@ func GetStatisticsReportForOrders(db *DaoDB, storeIDs, vendorIDs []int, fromDate
|
||||
SELECT
|
||||
IF(a.jx_store_id <> 0,a.jx_store_id,a.store_id) store_id,
|
||||
COUNT(*) order_counts,
|
||||
SUM(sale_price) sale_price,
|
||||
SUM(actual_pay_price) actual_pay_price,
|
||||
SUM(shop_price) shop_price,
|
||||
SUM(discount_money) discount_money,
|
||||
SUM(desired_fee) desired_fee,
|
||||
SUM(distance_freight_money) distance_freight_money,
|
||||
SUM(IF(a.vendor_id = a.waybill_vendor_id,waybill_tip_money,0)) waybill_tip_money,
|
||||
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_profit1,
|
||||
SUM(a.sale_price) sale_price,
|
||||
SUM(a.actual_pay_price) actual_pay_price,
|
||||
SUM(a.shop_price) shop_price,
|
||||
SUM(a.discount_money) discount_money,
|
||||
SUM(a.desired_fee) desired_fee,
|
||||
SUM(a.distance_freight_money) distance_freight_money,
|
||||
SUM(IF(a.vendor_id = a.waybill_vendor_id,a.waybill_tip_money,0)) waybill_tip_money,
|
||||
SUM(a.total_shop_money) total_shop_money,
|
||||
SUM(a.pm_subsidy_money) pm_subsidy_money,
|
||||
SUM(IF(a.earning_type = 1, a.earning_price, a.new_earning_price)) earning_price,
|
||||
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(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
|
||||
|
||||
Reference in New Issue
Block a user