zoujiajian пре 3 година
родитељ
комит
113aaaa620
1 измењених фајлова са 4 додато и 3 уклоњено
  1. 4 3
      netflix-dao/src/main/resources/mapper/CouponUserMapper.xml

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

@@ -132,9 +132,10 @@
                     else cu.status end) as couponUserStatus,
                (case
                     when cu.status = 'unused' then 0
-                    when cu.valid_end_time > now() then 1
-                    when ca.status = 0 then 2
-                    when cu.status = 'used' then 3
+                    when cu.valid_start_time < now() then 1
+                    when cu.valid_end_time < now() then 2
+                    when ca.status = 0 then 3
+                    when cu.status = 'used' then 4
                    end)                 as orderby
         from `coupon_user` cu
                  left join `coupon` c on c.id = cu.coupon_id