diff --git a/CoreCms.Net.Web.WebApi/Controllers/SQController.cs b/CoreCms.Net.Web.WebApi/Controllers/SQController.cs index 41a8681..23c0a5c 100644 --- a/CoreCms.Net.Web.WebApi/Controllers/SQController.cs +++ b/CoreCms.Net.Web.WebApi/Controllers/SQController.cs @@ -403,6 +403,7 @@ ISQRoomUnavailableTimesServices sQRoomUnavailableTimesServices /// 结束时间 时间戳 /// [HttpGet] + public async Task GetReservationRoomList([FromQuery] long startTime, [FromQuery] long endTime) { // 时间戳转DateTime @@ -410,7 +411,7 @@ ISQRoomUnavailableTimesServices sQRoomUnavailableTimesServices var end = DateTimeOffset.FromUnixTimeSeconds(endTime).DateTime; // 1. 查询所有可用房间 - var allRooms = await _SQRoomsServices.QueryListByClauseAsync(r => r.status == true); + var allRooms = await _SQRoomsServices.GetRoomList(); // 2. 查询有不可用时间段冲突的房间 var unavailableRoomIds = (await _sQRoomUnavailableTimesServices.QueryListByClauseAsync( @@ -424,7 +425,7 @@ ISQRoomUnavailableTimesServices sQRoomUnavailableTimesServices // 4. 可预约房间 = 所有可用房间 - 不可用房间 - 已预约房间 var availableRooms = allRooms - .Where(r => !unavailableRoomIds.Contains(r.id) && !reservedRoomIds.Contains(r.id)) + .Where(r => r.status == true && !unavailableRoomIds.Contains(r.id) && !reservedRoomIds.Contains(r.id)) .ToList(); return new WebApiDto()