zoujiajian hai 1 ano
pai
achega
f284a37abd
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      netflix-dao/src/main/resources/mapper/CouponUserMapper.xml

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

@@ -295,7 +295,7 @@
                cu.valid_end_time,
                if(type = 'discount', sku.price * (1 - c.discount), c.reduce_money) as couponMoney
         from (select * from coupon_user where user_id = #{userId} and status = 'unused' and valid_start_time < now() and valid_end_time > now()) cu
-                 inner join coupon c on c.id = cu.coupon_id
+                 inner join coupon c on c.id = cu.coupon_id and c.use_scope != 'renew'
                  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}
         order by couponMoney desc limit 1
@@ -312,6 +312,7 @@
                  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
+        and c.use_scope != 'renew'
         order by couponMoney desc limit 1
     </select>
 </mapper>