李昊 4 years ago
parent
commit
4b0f480634

+ 2 - 2
gx_api/GxPress/Repository/GxPress.Repository.Implement/UserRepository.cs

@@ -991,13 +991,13 @@ namespace GxPress.Repository.Implement
         public async Task<IEnumerable<UserInfoResult>> GetUserInfoNoFriendsResults(string keyword, IEnumerable<int> userIds)
         {
             var query = Q.NewQuery();
-            query.WhereNotIn(nameof(User.Id), userIds);
             if (!string.IsNullOrEmpty(keyword))
             {
-                query.WhereLike(nameof(User.Name), $"%{keyword}%");
+                query.OrWhereLike(nameof(User.Name), $"%{keyword}%");
                 query.OrWhereLike(nameof(User.Email), $"%{keyword}%");
                 query.OrWhereLike(nameof(User.Phone), $"%{keyword}%");
             }
+            query.WhereNotIn(nameof(User.Id), userIds);
             return await _repository.GetAllAsync<UserInfoResult>(query);
         }
     }