From 6139fec6d9f495bdbb5bd2ccaaccad0b75b2e468 Mon Sep 17 00:00:00 2001 From: ZihanChen821 <130351655+ZihanChen821@users.noreply.github.com> Date: Mon, 11 Mar 2024 20:13:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(mis-server):=20=E4=BF=AE=E5=A4=8D=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E8=B4=A6=E6=88=B7=E5=92=8C=E5=AF=BC=E5=87=BA=E5=85=85?= =?UTF-8?q?=E5=80=BC=E8=AE=B0=E5=BD=95=E6=8E=A5=E5=8F=A3=E7=BC=BA=E5=A4=B1?= =?UTF-8?q?limit=EF=BC=8Coffset=E8=BF=87=E6=BB=A4=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#1160)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/tidy-boxes-study.md | 5 +++++ apps/mis-server/src/services/export.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/tidy-boxes-study.md diff --git a/.changeset/tidy-boxes-study.md b/.changeset/tidy-boxes-study.md new file mode 100644 index 0000000000..d5c639cad1 --- /dev/null +++ b/.changeset/tidy-boxes-study.md @@ -0,0 +1,5 @@ +--- +"@scow/mis-server": patch +--- + +修复导出账户和导出充值记录接口缺失 limit,offset 过滤的问题 diff --git a/apps/mis-server/src/services/export.ts b/apps/mis-server/src/services/export.ts index ccbe07f4dc..52b64b816a 100644 --- a/apps/mis-server/src/services/export.ts +++ b/apps/mis-server/src/services/export.ts @@ -191,7 +191,7 @@ export const exportServiceServer = plugin((server) => { blocked ? { blocked } : {}, debt ? { balance: { $lt: new Decimal(0) } } : {}, ], - }, { populate: ["users", "users.user", "tenant"]})) + }, { populate: ["users", "users.user", "tenant"], limit, offset })) .map(recordFormat ?? ((x) => x)); if (records.length === 0) { @@ -335,7 +335,7 @@ export const exportServiceServer = plugin((server) => { while (offset < count) { const limit = Math.min(batchSize, count - offset); - const records = (await em.find(PayRecord, query)) + const records = (await em.find(PayRecord, query, { limit, offset })) .map(recordFormat ?? ((x) => x)); if (records.length === 0) {