Browse Source

优化餐厅信息查询排序逻辑

在 `RestaurantRepository.cs` 文件中,调整了查询结果的排序方式。移除了原有的 `pi.Date` 排序,并在选择数据后重新添加了按日期排序,以确保返回结果的顺序正确。
LEIYI 4 days ago
parent
commit
e47b7348ed

+ 2 - 1
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)
-                .OrderBy((pi, u) => pi.Date)
+                
                 .Select((pi, u) => new
                 {
                     pi.Id,
@@ -95,6 +95,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     pi.Tel,
                     pi.Remark
                 })
+                .OrderBy(pi => pi.Date)
                 .ToListAsync();
             if (!infos.Any()) return new JsonView() { Code = StatusCodes.Status400BadRequest, Msg = "数据未填写!",Data = Array.Empty<dynamic>() };