Просмотр исходного кода

fix 去重发送优惠券;过滤掉未生效优惠券

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

+ 2 - 0
netflix-dao/src/main/resources/mapper/CouponUserMapper.xml

@@ -35,6 +35,7 @@
         and cu.status != 'used'
         where cu.user_id = #{userId}
         and cu.channel != 'exCode'
+        and cu.valid_start_time > now()
         <if test="couponId == null">
             order by isAvailable desc
         </if>
@@ -101,6 +102,7 @@
                        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 cu.id is null
                 and ca.expiry_status != 0
         and ca.`status` != 0
              ) s