diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index 9ea0e5bd3..e3869d40a 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -204,8 +204,14 @@ - update wx_coupon c, wx_merchant m SET c.status = 1, c.update_date = now() - where c.status = 0 and m.status = 0 and m.id = c.merchant_id + update wx_coupon c + SET c.status = 1, c.update_date = now() + where c.status = 0 and + (select count(*) from wx_coupon_merchant cm, wx_merchant m + where m.id = cm.merchant_id + and c.id = cm.product_id + and cm.status = 0 + and m.status = 1) = 0