Browse Source

lutong提交

fcw 1 day ago
parent
commit
9f3d184c24

+ 4 - 4
alien-store/src/main/java/shop/alien/store/service/LifeUserService.java

@@ -124,11 +124,11 @@ public class LifeUserService extends ServiceImpl<LifeUserMapper, LifeUser> {
         lambdaQueryWrapper.eq(LifeFans::getFollowedId, fans.getFollowedId())
                 .eq(LifeFans::getFansId, fans.getFansId())
                 .eq(LifeFans::getDeleteFlag, 0);
-        int num = lifeFansMapper.selectCount(lambdaQueryWrapper);
-        if (num != 0) {
-            return 1;
+        int number = lifeFansMapper.selectCount(lambdaQueryWrapper);
+        if (number >= 1) {
+            return 0;
         }
-        lifeFansMapper.insert(fans);
+        int num = lifeFansMapper.insert(fans);
 
         if (num == 1) {
             LifeNotice notice = new LifeNotice();