| @@ -297,7 +297,7 @@ | |||||
| c.title,c.sale_price,c.use_price,c.price,c.unit, | c.title,c.sale_price,c.use_price,c.price,c.unit, | ||||
| (case when com.mc=1 then | (case when com.mc=1 then | ||||
| (select m.name from wx_merchant m, wx_coupon_merchant cm | (select m.name from wx_merchant m, wx_coupon_merchant cm | ||||
| where m.id = cm.merchant_id and cm.product_id=co.coupon_id) else '[多商户通用]' end) as merchant_name | |||||
| where m.id = cm.merchant_id and cm.product_id=co.coupon_id and m.status = 1) else '[多商户通用]' end) as merchant_name | |||||
| </sql> | </sql> | ||||
| <sql id="allAdminCouponOrderDetailColumns"> | <sql id="allAdminCouponOrderDetailColumns"> | ||||
| @@ -315,9 +315,9 @@ | |||||
| wx_coupon c, | wx_coupon c, | ||||
| (select tco.id as tcoid, | (select tco.id as tcoid, | ||||
| (select count(*) from wx_coupon_merchant tcm | (select count(*) from wx_coupon_merchant tcm | ||||
| where tcm.product_id = tco.coupon_id | |||||
| and tcm.status = 0) as mc | |||||
| from wx_coupon_order tco) com | |||||
| where tcm.product_id = tco.coupon_id | |||||
| and tcm.status = 0) as mc | |||||
| from wx_coupon_order tco) com | |||||
| where com.tcoid = co.id | where com.tcoid = co.id | ||||
| and co.coupon_type < 100 | and co.coupon_type < 100 | ||||
| and c.id = co.coupon_id | and c.id = co.coupon_id | ||||
| @@ -330,10 +330,14 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != merchantName and merchantName!=''"> | <if test=" null != merchantName and merchantName!=''"> | ||||
| and (case when com.mc=1 then | |||||
| (select m.name from wx_merchant m, wx_coupon_merchant cm | |||||
| where m.id = cm.merchant_id and cm.product_id=co.coupon_id) else '[多商户通用]' end) | |||||
| like concat('%', #{merchantName},'%') | |||||
| and (case when com.mc=1 | |||||
| then | |||||
| (select m.name from wx_merchant m, wx_coupon_merchant cm | |||||
| where m.id = cm.merchant_id | |||||
| and cm.product_id=co.coupon_id | |||||
| and m.status = 1) | |||||
| else'[多商户通用]' end) | |||||
| like concat('%', #{merchantName},'%') | |||||
| </if> | </if> | ||||
| <if test="startDate != null"> | <if test="startDate != null"> | ||||