chenbiao 3 ani în urmă
părinte
comite
6d00d0b10b

+ 3 - 3
netflix-web/src/main/java/com/cyksj/web/controller/manage/account/CmsAccountController.java

@@ -49,10 +49,10 @@ public class CmsAccountController {
                 .build()
         );
         search.getDataList().forEach((accountView)->{
-            Integer invited = homeGroupMapper.selectCount(Wrappers.lambdaQuery(HomeGroup.class).eq(HomeGroup::getAccountId, accountView.getId()).eq(HomeGroup::getStatus, "invited"));
-            GroupsTrips groupsTrips = Optional.ofNullable(groupsMapper.selectOne(Wrappers.lambdaQuery(GroupsTrips.class).eq(GroupsTrips::getAccountId, accountView.getId()).last(" limit 1"))).orElse(new GroupsTrips());
+            Integer invited = homeGroupMapper.selectCount(Wrappers.lambdaQuery(HomeGroup.class).eq(HomeGroup::getAccountId, accountView.getId()).eq(HomeGroup::getStatus, "uninvited"));
+            GroupsTrips groupsTrips = groupsMapper.selectOne(Wrappers.lambdaQuery(GroupsTrips.class).eq(GroupsTrips::getAccountId, accountView.getId()).last(" limit 1"));
             accountView.setUnInvited(invited);
-            accountView.setTotal(groupsTrips.getNum() - groupsTrips.getAvailableNum());
+            accountView.setTotal(groupsTrips == null ? 0 : groupsTrips.getNum() - groupsTrips.getAvailableNum());
         });
         return GatewayResponse.SUCCESS.newBuilder().toResult(search);
     }