Browse Source

修改餐厅信息查询的排序方式

在 `RestaurantRepository.cs` 文件中,将 `infos` 的查询排序从按 `Date` 降序改为按 `Date` 升序。这一变化将影响返回的餐厅信息顺序,使其按照日期从早到晚排列。
LEIYI 4 days ago
parent
commit
534d974e88

+ 1 - 2
OASystem/OASystem.Infrastructure/Repositories/Groups/RestaurantRepository.cs

@@ -81,7 +81,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             var infos = await _sqlSugar
                 .Queryable<Grp_RestaurantInfo, Sys_Users>((pi, u) => new JoinQueryInfos(JoinType.Left, pi.CreateUserId == u.Id))
                 .Where((pi, u) => pi.IsDel == 0 && pi.GroupId == groupId)
-                .OrderByDescending((pi, u) => pi.Date)
+                .OrderBy((pi, u) => pi.Date)
                 .Select((pi, u) => new
                 {
                     pi.Id,
@@ -95,7 +95,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     pi.Tel,
                     pi.Remark
                 })
-                .OrderByDescending(x => x.Date) 
                 .ToListAsync();
             if (!infos.Any()) return new JsonView() { Code = StatusCodes.Status400BadRequest, Msg = "数据未填写!",Data = Array.Empty<dynamic>() };