@@ -138,9 +138,9 @@
<select id="allUserList" resultType="com.caimei.modules.hehe.entity.CmHeheReceiveUser">
select u.userId as userId,u.nickName,u.mobile,u.userIdentity,count(rc.id) as receiveNum, count(chc.id) as ableNum
from cm_hehe_user u
- left join cm_hehe_receive_coupon rc on u.userId = rc.userId and rc.delFlag = 0
+ left join cm_hehe_receive_coupon rc on u.userId = rc.userId and rc.delFlag = 0 and rc.couponId in (select id from cm_hehe_coupon where delFlag = 0)
left join cm_hehe_coupon chc on rc.couponId = chc.id
- and NOW() <![CDATA[ < ]]> DATE_ADD(rc.receiveTime ,interval chc.usePeriod DAY)
+ and NOW() <![CDATA[ < ]]> DATE_ADD(rc.receiveTime ,interval chc.usePeriod DAY) and rc.status = 1
and chc.delFlag = 0
<where>
<if test="nickName != null and nickName != ''">