diff options
| author | Adam Soltys <[email protected]> | 2024-11-28 09:07:27 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-11-28 09:07:27 -0800 |
| commit | 79c048ccf50705fb786c885baf66f713ae70cf9c (patch) | |
| tree | a1c866b0854c4ad15103087767e6c5024ae5e36c /lib | |
| parent | 07eb7a473181113003dca15eb47c9667eddeac1b (diff) | |
| download | coinos-server-79c048ccf50705fb786c885baf66f713ae70cf9c.tar.gz coinos-server-79c048ccf50705fb786c885baf66f713ae70cf9c.zip | |
set last time for payments
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/payments.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/payments.ts b/lib/payments.ts index 66dafd26..fb394550 100644 --- a/lib/payments.ts +++ b/lib/payments.ts @@ -127,7 +127,11 @@ export const debit = async ({ await s(`payment:${hash}`, id); await s(`payment:${id}`, p); - await db.lPush(`${aid || uid}:payments`, id); + await db + .multi() + .lPush(`${aid || uid}:payments`, id) + .set(`${aid || uid}:payments:last`, p.created) + .exec(); l(user.username, "sent", type, amount); //emit(user.id, "payment", p); @@ -221,6 +225,7 @@ export const credit = async ({ .set(`payment:${p.id}`, JSON.stringify(p)) .lPush(`${aid || uid}:payments`, p.id) .incrBy(`${balanceKey}:${aid || uid}`, amount) + .set(`${aid || uid}:payments:last`, p.created) .exec(); if (inv.items?.length) { |
