|
|
@@ -192,8 +192,8 @@ public class UserService {
|
|
|
|
|
|
// 加积分
|
|
|
if (collectionId != null && invitor != null) {
|
|
|
- // 额度或者额度为空
|
|
|
- if (collection.getVipQuota() > 0 || ObjectUtils.isEmpty(collection.getVipQuota())) {
|
|
|
+ // 额度或者额度为空, 库存不为空
|
|
|
+ if (collection.getStock() > 0 && (collection.getVipQuota() > 0 || ObjectUtils.isEmpty(collection.getVipQuota()))) {
|
|
|
int countUser = userRepo.countAllByCollectionIdAndCollectionInvitor(collectionId, invitor);
|
|
|
// 邀请人数
|
|
|
if (countUser >= collection.getAssignment()) {
|
|
|
@@ -210,7 +210,7 @@ public class UserService {
|
|
|
.point(1)
|
|
|
.build());
|
|
|
// 扣除藏品额度
|
|
|
- if(ObjectUtils.isNotEmpty(collection.getVipQuota())){
|
|
|
+ if (ObjectUtils.isNotEmpty(collection.getVipQuota())) {
|
|
|
collectionService.decreaseQuota(collectionId, 1);
|
|
|
}
|
|
|
}
|