zoujiajian 3 лет назад
Родитель
Сommit
b6ceb4a907
1 измененных файлов с 3 добавлено и 5 удалено
  1. 3 5
      netflix-dao/src/main/resources/mapper/CouponUserMapper.xml

+ 3 - 5
netflix-dao/src/main/resources/mapper/CouponUserMapper.xml

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