diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java index d0c257ea..2f9ce751 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java @@ -289,7 +289,11 @@ public class HighCouponServiceImpl implements HighCouponService { List coupons = highCouponMapper.selectByExample(example); if (coupons != null && coupons.size() > 0) { - return JSON.parseArray(JSON.toJSONString(coupons), HighCouponModel.class); + List models = JSON.parseArray(JSON.toJSONString(coupons), HighCouponModel.class); + for (HighCouponModel highCouponModel : models) { + highCouponModel.setStockCount(highCouponCodeService.getStockCountByCoupon(highCouponModel.getId())); + } + return models; } return new ArrayList<>(); }