租房记录
This commit is contained in:
parent
b7a7549aa0
commit
5ff4bbe0b4
|
|
@ -135,11 +135,12 @@ const getAllRooms = async (req, res) => {
|
||||||
const formattedRooms = await Promise.all(rows.map(async (room) => {
|
const formattedRooms = await Promise.all(rows.map(async (room) => {
|
||||||
const formattedRoom = formatRoomData(room);
|
const formattedRoom = formatRoomData(room);
|
||||||
|
|
||||||
// 查询非过期的租房信息
|
// 查询非过期且未删除的租房信息
|
||||||
const rentals = await Rental.findAll({
|
const rentals = await Rental.findAll({
|
||||||
where: {
|
where: {
|
||||||
roomId: room.id,
|
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 formattedRoom = formatRoomData(room);
|
||||||
|
|
||||||
// 查询非过期的租房信息
|
// 查询非过期且未删除的租房信息
|
||||||
const rentals = await Rental.findAll({
|
const rentals = await Rental.findAll({
|
||||||
where: {
|
where: {
|
||||||
roomId: room.id,
|
roomId: room.id,
|
||||||
status: { [Op.ne]: 'expired' }
|
status: { [Op.ne]: 'expired' },
|
||||||
|
isDeleted: 0
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue