|
|
@@ -64,16 +64,12 @@
|
|
|
ca.expiry_status,
|
|
|
ca.remain_num,
|
|
|
(case
|
|
|
- when ca.expiry_status = 0 then 'stop'
|
|
|
- when ca.`status` = 0 then 'stop'
|
|
|
when ca.remain_num <= 0 then 'over'
|
|
|
when cu.id is null then 'collecting'
|
|
|
when cu.id is not null
|
|
|
then 'received' end) as couponStatus,
|
|
|
(case
|
|
|
- when ca.expiry_status = 0 then 2
|
|
|
- when ca.`status` = 0 then 2
|
|
|
- when remain_num <= 0 then 3
|
|
|
+ when remain_num <= 0 then 2
|
|
|
when cu.id is null then 0
|
|
|
when cu.id is not null
|
|
|
then 1 end) as `order`
|
|
|
@@ -83,6 +79,8 @@
|
|
|
left join coupon_user cu on cu.coupon_id = c.id and cu.user_id = #{userId}
|
|
|
where ca.deleted is true
|
|
|
and c.deleted is true
|
|
|
+ and ca.expiry_status != 0
|
|
|
+ and ca.`status` != 0
|
|
|
order by `order`
|
|
|
</select>
|
|
|
</mapper>
|