Skip to content

Commit

Permalink
fix(mis-server): 修复导出账户和导出充值记录接口缺失limit,offset过滤的问题 (#1160)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZihanChen821 committed Mar 11, 2024
1 parent 7b9e0b6 commit 6139fec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/tidy-boxes-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@scow/mis-server": patch
---

修复导出账户和导出充值记录接口缺失 limit,offset 过滤的问题
4 changes: 2 additions & 2 deletions apps/mis-server/src/services/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 6139fec

Please sign in to comment.