|
@@ -129,7 +129,7 @@
|
|
|
<if test="userId == null or userId == 0">
|
|
|
AND couponType != 2
|
|
|
AND NOW() <![CDATA[ > ]]> startDate
|
|
|
- AND NOW() <![CDATA[ < ]]> if(receiveFlag = 1,endDate,date_add(startDate,interval receivePeriod day)
|
|
|
+ AND NOW() <![CDATA[ < ]]> if(receiveFlag = 1,endDate,date_add(startDate,interval receivePeriod day))
|
|
|
</if>
|
|
|
<if test="userId > 0">
|
|
|
AND id NOT IN(SELECT couponId FROM cm_coupon_club WHERE userId = #{userId})
|
|
@@ -139,8 +139,8 @@
|
|
|
AND couponType = 4))
|
|
|
and NOW() <![CDATA[ > ]]> startDate
|
|
|
and NOW() <![CDATA[ < ]]> if(receiveFlag = 1,endDate,
|
|
|
- date_add(if(#{registerTime} <![CDATA[ > ]]> startDate,#{registerTime},startDate),
|
|
|
- interval receivePeriod day))
|
|
|
+ date_add(if(#{registerTime} <![CDATA[ > ]]> startDate,#{registerTime},startDate),interval receivePeriod day)
|
|
|
+ )
|
|
|
</if>
|
|
|
ORDER BY
|
|
|
createDate DESC
|