|
|
@@ -66,10 +66,12 @@ public class CmsAccountController {
|
|
|
|
|
|
SearchResult<AccountView> search = beanSearcher.search(AccountView.class, mapBuilder.build());
|
|
|
search.getDataList().forEach((accountView)->{
|
|
|
- Integer invited = homeGroupMapper.selectCount(Wrappers.lambdaQuery(HomeGroup.class).eq(HomeGroup::getAccountId, accountView.getId()).eq(HomeGroup::getStatus, "uninvited"));
|
|
|
+ Integer invited = homeGroupMapper.selectCount(Wrappers.lambdaQuery(HomeGroup.class).eq(HomeGroup::getAccountId, accountView.getId()).eq(HomeGroup::getStatus, "invited"));
|
|
|
GroupsTrips groupsTrips = groupsMapper.selectOne(Wrappers.lambdaQuery(GroupsTrips.class).eq(GroupsTrips::getAccountId, accountView.getId()).last(" limit 1"));
|
|
|
- accountView.setUnInvited(invited);
|
|
|
- accountView.setTotal(groupsTrips == null ? 0 : groupsTrips.getNum() - groupsTrips.getAvailableNum());
|
|
|
+ int total = groupsTrips == null ? 0 : groupsTrips.getNum() - groupsTrips.getAvailableNum();
|
|
|
+ Integer unInvited = Math.max(total - invited, 0);
|
|
|
+ accountView.setUnInvited(unInvited);
|
|
|
+ accountView.setTotal(total);
|
|
|
});
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
}
|