This commit is contained in:
lik
2026-09-03 18:39:40 +08:00
parent f81f6906f0
commit 1f2da22cae
2 changed files with 7 additions and 2 deletions
+5 -1
View File
@@ -166,7 +166,7 @@ const EscortRecordSchema = mongoose.Schema(
* @returns {Promise<Array>} 陪诊记录列表(按预约日期倒序)
*/
EscortRecordSchema.statics.findRecords = async function (options = {}, cb) {
const { page = 1, pageSize = 20, status, userId, appointmentDate } = options;
const { page = 1, pageSize = 20, status, userId, appointmentDate, healthProfileId } = options;
const filter = {};
if (status && Array.isArray(status) && status.length > 0) {
@@ -177,6 +177,10 @@ EscortRecordSchema.statics.findRecords = async function (options = {}, cb) {
filter.userId = userId;
}
if (healthProfileId) {
filter.healthProfileId = healthProfileId;
}
if (appointmentDate) {
const start = new Date(appointmentDate);
const end = new Date(start);