left join wx_card_transfer_info wcs on wcs.coupon_order_id = ci.id
where wc.id = c.id) as transfer_count,
(select sum(round(ci.sale_amount/100,2)) from wx_card_info ci
(select sum(ci.sale_amount) from wx_card_info ci
left join wx_coupon wc on wc.id = ci.coupon_id
where wc.id = c.id) as sale_amount,
(select sum(round(wcs.real_payment/100,2)) from wx_card_info ci
(select sum(wcs.real_payment) from wx_card_info ci
left join wx_coupon wc on wc.id = ci.coupon_id
left join wx_card_spend wcs on wcs.card_id = ci.id
where wc.id = c.id) as sum_payment,
(select sum(round(sc.subsidy/100,2)) from wx_card_info ci
(select sum(sc.subsidy) from wx_card_info ci
left join wx_coupon wc on wc.id = ci.coupon_id
left join wx_merchant_subsidy sc on sc.coupon_order_id = ci.id
where wc.id = c.id) as sum_subsidy
@@ -760,7 +760,7 @@
(select count(wco.id) from wx_coupon_order wco where wco.coupon_id = c.id) as sale_count,
(select count(wco.id) from wx_coupon wc,wx_coupon_order wco where wco.coupon_id = wc.id and wco.coupon_order_status = 1 and wc.id = c.id) as sum_payment,
(select count(wco.id) from wx_coupon wc,wx_coupon_order wco where wco.coupon_id = wc.id and wco.coupon_order_status = 3 and wc.id = c.id) as backpay_count,
(select sum(round(sc.subsidy/100,2)) from wx_coupon wc
(select sum(sc.subsidy) from wx_coupon wc
left join wx_coupon_order wo on wo.coupon_id = wc.id
left join wx_merchant_subsidy sc on sc.coupon_order_id = wo.id