diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index 7f1ab02e3..c52f84e07 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -669,9 +669,6 @@ select DATE_FORMAT(ci.create_date,'%Y-%m-%d') xtime,sum(ci.sale_amount) xcount from wx_card_info ci left join wx_coupon c on c.id = ci.coupon_id where ci.create_date between #{startdate} and #{enddate} - - and c.id = #{id} - group by xtime @@ -680,21 +677,15 @@ left join wx_coupon c on c.id = ci.coupon_id left join wx_card_spend wcs on wcs.card_id = ci.id where ci.create_date between #{startdate} and #{enddate} - - and c.id = #{id} - group by xtime select c.*, - (select count(distinct wco.owner_id) from wx_coupon_order wco where wco.coupon_id = c.id) as sale_count, + (select count(distinct wco.id) from wx_coupon_order wco where wco.coupon_id = c.id) as sale_count, (select count(distinct 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 payment_count, (select count(distinct 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 from wx_coupon c where 1=1