zoujiajian 1 year ago
parent
commit
11fae566c7
1 changed files with 4 additions and 4 deletions
  1. 4 4
      netflix-dao/src/main/resources/mapper/CouponUserMapper.xml

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

@@ -290,8 +290,8 @@
 
     <select id="selectUserCouponByGidAndPrice" resultType="com.cyksj.model.entity.Coupon">
         select c.*,
-               if(type = 'discount', ${sku.price} * (1 - c.discount), c.reduce_money) as couponMoney,
-        from (select coupon_id from coupon_user where user_id = #{userId} and status = 'unused' and valid_start_time > now() and valid_end_time &lt; now()) cu
+               if(type = 'discount', sku.price * (1 - c.discount), c.reduce_money) as couponMoney
+        from (select coupon_id from coupon_user where user_id = #{userId} and status = 'unused' and valid_start_time &lt; now() and valid_end_time > now()) cu
                  inner join coupon c on c.id = cu.coupon_id
                  inner join coupon_sku cs on cs.coupon_id = c.id and cs.goods_id = #{goodsId}
                  inner join goods_don_sku sku on sku.id = cs.sku_id and sku.status is true and sku.price = #{price}
@@ -300,8 +300,8 @@
 
     <select id="selectUserCouponBySkuId" resultType="com.cyksj.model.entity.Coupon">
         select c.*,
-               if(type = 'discount', ${sku.price} * (1 - c.discount), c.reduce_money) as couponMoney,
-        from (select coupon_id from coupon_user where user_id = #{userId} and status = 'unused' and valid_start_time > now() and valid_end_time &lt; now()) cu
+               if(type = 'discount', sku.price * (1 - c.discount), c.reduce_money) as couponMoney
+        from (select coupon_id from coupon_user where user_id = #{userId} and status = 'unused' and valid_start_time &lt; now() and valid_end_time > now()) cu
                  inner join coupon c on c.id = cu.coupon_id
                  inner join coupon_sku cs on cs.coupon_id = c.id and cs.sku_id = #{skuId}
                  inner join goods_don_sku sku on sku.id = cs.sku_id and sku.status is true