|
|
@@ -1317,7 +1317,8 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
couponUser.setCouponId(exists.getPopularizeCouponId());
|
|
|
couponUser.setPopularizeId(exists.getPopularizeId());
|
|
|
}
|
|
|
- if (exists.getPopularizeId() == null) {
|
|
|
+ //非渠道推广 推广优惠码只可使用一次
|
|
|
+ if ((exists.getPopularizeId() != null && exists.getIsGeneral()) || exists.getPopularizeId() == null) {
|
|
|
CouponUser received = couponUserMapper.selectOne(Wrappers.lambdaQuery(CouponUser.class).eq(CouponUser::getUserId, userId).eq(CouponUser::getCouponId, couponUser.getCouponId()).last("limit 1"));
|
|
|
if (received != null && received.getStatus() != CouponUser.Status.unused) {
|
|
|
throw BusinessRuntimeException.getInstance("您已使用该优惠码所对应的优惠券");
|