From 5ff4bbe0b47695747af3191da860374f07fa0984 Mon Sep 17 00:00:00 2001 From: wangxiaoxian <1094175543@qq.com> Date: Sat, 7 Mar 2026 18:57:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=9F=E6=88=BF=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/roomController.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/controllers/roomController.js b/controllers/roomController.js index 407f67b..db460da 100644 --- a/controllers/roomController.js +++ b/controllers/roomController.js @@ -135,11 +135,12 @@ const getAllRooms = async (req, res) => { const formattedRooms = await Promise.all(rows.map(async (room) => { const formattedRoom = formatRoomData(room); - // 查询非过期的租房信息 + // 查询非过期且未删除的租房信息 const rentals = await Rental.findAll({ where: { roomId: room.id, - status: { [Op.ne]: 'expired' } + status: { [Op.ne]: 'expired' }, + isDeleted: 0 } }); @@ -194,11 +195,12 @@ const getRoomById = async (req, res) => { // 格式化房间数据 const formattedRoom = formatRoomData(room); - // 查询非过期的租房信息 + // 查询非过期且未删除的租房信息 const rentals = await Rental.findAll({ where: { roomId: room.id, - status: { [Op.ne]: 'expired' } + status: { [Op.ne]: 'expired' }, + isDeleted: 0 } });