Explorar o código

优化用户优惠券过期SQL

codingliang hai 1 ano
pai
achega
980e92f1c5
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/main/resources/mapper/coupon/TbCouponUserMapper.xml

+ 1 - 1
src/main/resources/mapper/coupon/TbCouponUserMapper.xml

@@ -27,7 +27,7 @@
         update tb_coupon_user
         set status = 2
         where status = 0
-          and date_format(expiration_time, '%Y-%m-%d %H:%i:%S') < date_format(now(), '%Y-%m-%d %H:%i:%S')
+          and expiration_time < date_format(now(), '%Y-%m-%d %H:%i:%S')
     </update>
 
     <select id="selectCouponByUserId" resultType="com.sqx.modules.coupon.entity.TbCouponUser">