租房记录
This commit is contained in:
parent
baecadb626
commit
d62de12d1f
|
|
@ -135,13 +135,14 @@ 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' },
|
||||
isDeleted: 0
|
||||
}
|
||||
},
|
||||
order: [['createTime', 'DESC']]
|
||||
});
|
||||
|
||||
// 格式化租房信息
|
||||
|
|
|
|||
Loading…
Reference in New Issue