diff --git a/luoo_user/src/main/java/com/luoo/user/dao/UserInfoDao.java b/luoo_user/src/main/java/com/luoo/user/dao/UserInfoDao.java index 89e3e75..fd33fe6 100644 --- a/luoo_user/src/main/java/com/luoo/user/dao/UserInfoDao.java +++ b/luoo_user/src/main/java/com/luoo/user/dao/UserInfoDao.java @@ -55,5 +55,6 @@ public interface UserInfoDao extends JpaRepository, JpaSpecifi " and vip_expire_time < now()", nativeQuery = true) public List getExpireVipList(); - public List getUserInfosByNickNameLike(String nickName); + @Query(value = "select * from tb_user_info where nick_name like ?1 limit 50", nativeQuery = true) + public List getUserInfosByNickNameLikeLimit50(String nickName); } diff --git a/luoo_user/src/main/java/com/luoo/user/service/UserInfoService.java b/luoo_user/src/main/java/com/luoo/user/service/UserInfoService.java index dd469f9..87351aa 100644 --- a/luoo_user/src/main/java/com/luoo/user/service/UserInfoService.java +++ b/luoo_user/src/main/java/com/luoo/user/service/UserInfoService.java @@ -868,7 +868,7 @@ public class UserInfoService { if (StringUtils.isBlank(nickName)) { return null; } else { - return userInfoDao.getUserInfosByNickNameLike("%" + nickName + "%"); + return userInfoDao.getUserInfosByNickNameLikeLimit50("%" + nickName + "%"); } }