diff --git a/lib/game/api/user.js b/lib/game/api/user.js index c995f9c..c788e65 100644 --- a/lib/game/api/user.js +++ b/lib/game/api/user.js @@ -454,9 +454,10 @@ router.get('/money-history', auth.tokenAuth, jsonResponse((request) => { return db['users.money'].findEx({user: request.user._id}, {sort: {date: -1}, skip: page*pageSize, limit: pageSize+1}) .then(data => { var spliced = data.splice(0, pageSize); + var calculated = spliced.map((row)=>{row.balance += row.change; return row;}); return { page, - list: spliced, + list: calculated, hasMore: data.length > 0 }; })