Browse Source

优化用户优惠券过期SQL

codingliang 1 năm trước cách đây
mục cha
commit
980e92f1c5
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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">