Explorar el Código

fix 停用优惠卷不展示

zoujiajian hace 3 años
padre
commit
b6ceb4a907
Se han modificado 1 ficheros con 3 adiciones y 5 borrados
  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.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>