优化订单搜索和对账的批量取数与索引查询

This commit is contained in:
黄健铭 committed 2026-12-05 19:15:04 -08:00
1 parent 3aebb62252
commit cf0b0be83f
16 files changed
+671 -186

No files matched your search

+3 -3
View File
@@ -568,7 +568,7 @@ function rowDetail(ledger, row, actor) {
...saved,
};
}
function projection(ledger, id) {
function projection(ledger, id, requests = { pending: pending(ledger, id), approved: approved(ledger, id) }) {
const compact = row =>
row
? {
@@ -585,10 +585,10 @@ function projection(ledger, id) {
note: row.note,
}
: null;
const request = pending(ledger, id);
const { pending: request, approved: accepted } = requests;
return {
changePending: request ? { ...compact(request), stale: stale(ledger, request) } : null,
changeApproved: compact(approved(ledger, id)),
changeApproved: compact(accepted),
};
}
function eligibility(ledger, order, action) {