优化订单搜索和对账的批量取数与索引查询
This commit is contained in:
1 parent
3aebb62252
commit
cf0b0be83f
16 files changed
+671
-186
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user