李昊 4 år sedan
förälder
incheckning
082abf918a

+ 3 - 1
gx_api/GxPress/Repository/GxPress.Repository.Implement/Media/MediaRepository.cs

@@ -196,8 +196,10 @@ namespace GxPress.Repository.Implement.Media
             //排序
             if (string.IsNullOrEmpty(request.Sort))
                 query.OrderByDesc(nameof(Entity.tede2.Media.Media.CreatedDate));
-            else
+            else if (request.Sort.Equals("SellAmount"))
                 query.OrderByDesc(nameof(Entity.tede2.Media.Media.SellAmount));
+            else if (request.Sort.Equals("ReadCount"))
+                query.OrderByDesc(nameof(Entity.tede2.Media.Media.ReadCount));
             var item = await _repository.GetAllAsync(query.ForPage(request.Page, request.PerPage));
             result.Items = item;
             return result;

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

@@ -935,7 +935,7 @@ 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))
+            if (!string.IsNullOrEmpty(request.Sort)&&request.Sort.Equals("AccumulativePrice"))
                 query.OrderByDesc(nameof(User.AccumulativePrice));
             else
                 query.OrderByDesc(nameof(User.CreatedDate));