李昊 4 éve
szülő
commit
574c16519c

+ 4 - 0
gx_api/GxPress/Repository/GxPress.Repository.Implement/UserRepository.cs

@@ -935,6 +935,10 @@ namespace GxPress.Repository.Implement
             if (request.RenewalCount > 0)
                 query.Where(nameof(User.RenewalCount), request.RenewalCount);
             result.Total = await _repository.CountAsync(query);
+            if (!string.IsNullOrEmpty(request.Sort))
+                query.OrderByDesc(nameof(User.AccumulativePrice));
+            else
+                query.OrderByDesc(nameof(User.CreatedDate));
             var items = await _repository.GetAllAsync(query.ForPage(request.Page, request.PerPage));
             result.Items = items.Select(n => _mapper.Map<UserDetail>(n));
             return result;