|
|
|
@ -154,12 +154,11 @@ public class ProductQueryServiceImpl implements ProductQueryService { |
|
|
|
if (CollUtil.isNotEmpty(list)) { |
|
|
|
list.forEach(record -> { |
|
|
|
if (Objects.nonNull(record.getPurchaseTimeLimit())) { |
|
|
|
if (PurchaseTimeLimitTypeEnum.UNLIMITED.equals(record.getPurchaseTimeLimit())) { |
|
|
|
resultList.add(record); |
|
|
|
} else { |
|
|
|
resultList.add(record); |
|
|
|
if (PurchaseTimeLimitTypeEnum.FIRST_TIME_ONLY.equals(record.getPurchaseTimeLimit())) { |
|
|
|
int count = purchaseProductRecordQueryService.countPurchasedBy(record.getProductSpecId(), userId); |
|
|
|
if (count < record.getPurchaseTimeLimit().getValue()) { |
|
|
|
resultList.add(record); |
|
|
|
if (count >= record.getPurchaseTimeLimit().getValue()) { |
|
|
|
record.setIsAllowPurchase(false); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|