Bläddra i källkod

vip/新用户多一个

licailing 3 år sedan
förälder
incheckning
a575984c02
1 ändrade filer med 9 tillägg och 1 borttagningar
  1. 9 1
      src/main/java/com/izouma/nineth/service/UserService.java

+ 9 - 1
src/main/java/com/izouma/nineth/service/UserService.java

@@ -1212,7 +1212,15 @@ public class UserService {
         }
         log.info("修改限购{}", invitor);
         UserProperty userProperty = userPropertyRepo.findById(invitor).orElse(new UserProperty(invitor, 0));
-        if (userProperty.getMaxCount() < 10 && userProperty.getMaxCount() != point) {
+        if (userProperty.getMaxCount() < 10) {
+            if (parent.getVipPurchase() > 0 || parent.getCreatedAt().isAfter(LocalDateTime.of(2022, 7, 5, 0, 0, 0))) {
+                if (userProperty.getMaxCount() != point + 1) {
+                    userProperty.setMaxCount(point + 1);
+                    userPropertyRepo.save(userProperty);
+                    log.info("邀请绑卡限购+1,{}", invitor);
+                    return;
+                }
+            }
             userProperty.setMaxCount(point);
             userPropertyRepo.save(userProperty);
             log.info("邀请绑卡限购+1,{}", invitor);