|
|
|
@@ -428,11 +428,13 @@ |
|
|
|
(select count(*) from wx_coupon_order o |
|
|
|
left join wx_coupon co on(o.`coupon_id`=co.id) |
|
|
|
left join wx_coupon_merchant cm on(cm.product_id=co.id) |
|
|
|
inner join wx_c_user_basic_info c on(o.c_user_id=c.id) where cm.`merchant_id`=m.id and o.coupon_order_status=1 |
|
|
|
<if test="starttime != null and starttime!=''"> |
|
|
|
inner join wx_c_user_basic_info c on(o.c_user_id=c.id) |
|
|
|
left join wx_merchant_b_user mb on(mb.id=c.id) |
|
|
|
where cm.`merchant_id`=m.id and o.coupon_order_status=1 and mb.merchant_id=m.id |
|
|
|
<if test="starttime != null"> |
|
|
|
and o.create_date >= #{starttime} |
|
|
|
</if> |
|
|
|
<if test="endtime != null and endtime!=''"> |
|
|
|
<if test="endtime != null"> |
|
|
|
and o.create_date <= #{endtime} |
|
|
|
</if> |
|
|
|
) consumeCount, |
|
|
|
@@ -440,11 +442,13 @@ |
|
|
|
(select count(distinct c.id) from wx_coupon_order o |
|
|
|
left join wx_coupon co on(o.`coupon_id`=co.id) |
|
|
|
left join wx_coupon_merchant cm on(cm.product_id=co.id) |
|
|
|
inner join wx_c_user_basic_info c on(o.c_user_id=c.id) where cm.`merchant_id`=m.id and o.coupon_order_status=1 |
|
|
|
<if test="starttime != null and starttime!=''"> |
|
|
|
inner join wx_c_user_basic_info c on(o.c_user_id=c.id) |
|
|
|
left join wx_merchant_b_user mb on(mb.id=c.id) |
|
|
|
where cm.`merchant_id`=m.id and o.coupon_order_status=1 and mb.merchant_id=m.id |
|
|
|
<if test="starttime != null"> |
|
|
|
and o.create_date >= #{starttime} |
|
|
|
</if> |
|
|
|
<if test="endtime != null and endtime!=''"> |
|
|
|
<if test="endtime != null"> |
|
|
|
and o.create_date <= #{endtime} |
|
|
|
</if> |
|
|
|
) consumeCountP, |
|
|
|
@@ -452,13 +456,16 @@ |
|
|
|
IFNULL((select sum(co.price) from wx_coupon_order o |
|
|
|
left join wx_coupon co on(o.`coupon_id`=co.id) |
|
|
|
left join wx_coupon_merchant cm on(cm.product_id=co.id) |
|
|
|
inner join wx_c_user_basic_info c on(o.c_user_id=c.id) where cm.`merchant_id`=m.id and o.coupon_order_status=1 |
|
|
|
<if test="starttime != null and starttime!=''"> |
|
|
|
inner join wx_c_user_basic_info c on(o.c_user_id=c.id) |
|
|
|
left join wx_merchant_b_user mb on(mb.id=c.id) |
|
|
|
where cm.`merchant_id`=m.id and o.coupon_order_status=1 and mb.merchant_id=m.id |
|
|
|
<if test="starttime != null"> |
|
|
|
and o.create_date >= #{starttime} |
|
|
|
</if> |
|
|
|
<if test="endtime != null and endtime!=''"> |
|
|
|
<if test="endtime != null"> |
|
|
|
and o.create_date <= #{endtime} |
|
|
|
</if> |
|
|
|
|
|
|
|
),0) tradeAmt |
|
|
|
|
|
|
|
from wx_merchant m where 1=1 |
|
|
|
@@ -494,6 +501,12 @@ |
|
|
|
<if test=" null != couponName "> |
|
|
|
and co.`title` like concat('%', #{couponName},'%') |
|
|
|
</if> |
|
|
|
<if test="starttime != null"> |
|
|
|
and o.create_date >= #{starttime} |
|
|
|
</if> |
|
|
|
<if test="endtime != null"> |
|
|
|
and o.create_date <= #{endtime} |
|
|
|
</if> |
|
|
|
order by o.create_date desc |
|
|
|
</select> |
|
|
|
|
|
|
|
|