|
|
|
@@ -393,7 +393,8 @@ |
|
|
|
from wx_coupon_merchant cm, |
|
|
|
(select tco.id as tcoid, |
|
|
|
(select count(*) from wx_coupon_merchant tcm |
|
|
|
where tcm.product_id = tco.coupon_id) as mc |
|
|
|
where tcm.product_id = tco.coupon_id |
|
|
|
and tcm.status = 0) as mc |
|
|
|
from wx_coupon_order tco) com, |
|
|
|
wx_coupon c, |
|
|
|
wx_c_user cu, |
|
|
|
@@ -429,7 +430,8 @@ |
|
|
|
from wx_coupon_order co,wx_coupon c,wx_c_user cu,wx_coupon_merchant cm, |
|
|
|
(select tco.id as tcoid, |
|
|
|
(select count(*) from wx_coupon_merchant tcm |
|
|
|
where tcm.product_id = tco.coupon_id) as mc |
|
|
|
where tcm.product_id = tco.coupon_id |
|
|
|
and tcm.status = 0) as mc |
|
|
|
from wx_coupon_order tco) com |
|
|
|
where com.mc = 1 |
|
|
|
and com.tcoid = co.id |
|
|
|
@@ -474,11 +476,13 @@ |
|
|
|
from wx_coupon_order co,wx_coupon_merchant cm, |
|
|
|
(select tco.id as tcoid, |
|
|
|
(select count(*) from wx_coupon_merchant tcm |
|
|
|
where tcm.product_id = tco.coupon_id) |
|
|
|
where tcm.product_id = tco.coupon_id and |
|
|
|
and tcm.status = 0) |
|
|
|
as mc |
|
|
|
from wx_coupon_order tco) com |
|
|
|
where com.mc = 1 |
|
|
|
and com.tcoid = co.id |
|
|
|
and cm.status = 0 |
|
|
|
and cm.merchant_id = #{merchantId} |
|
|
|
and cm.product_id = co.coupon_id |
|
|
|
<if test="startDate != null"> |
|
|
|
|