From 1cc0962528863c194c88fb6e4b8aaa7a861f994a Mon Sep 17 00:00:00 2001 From: Stefan Dresselhaus Date: Sun, 20 Nov 2016 15:04:04 +0100 Subject: [PATCH] forgot to filter by user-id in wallet -.- --- Handler/Wallet.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Handler/Wallet.hs b/Handler/Wallet.hs index eee3ac8..3710217 100644 --- a/Handler/Wallet.hs +++ b/Handler/Wallet.hs @@ -52,7 +52,11 @@ getWalletR = getWalletDetailsR 6 7 getWalletDetailsR :: Int64 -> Int64 -> Handler Html getWalletDetailsR hrs days = loginOrDo (\(uid,user) -> do now <- liftIO getCurrentTime - trans <- runDB $ selectList [TransactionDateTime >. (addUTCTime ((fromIntegral $ -(hrs*3600)) :: NominalDiffTime) now)] [Desc TransactionDateTime] + trans <- runDB $ selectList + [TransactionDateTime >. (addUTCTime ((fromIntegral $ -(hrs*3600)) :: NominalDiffTime) now) + ,TransactionUser ==. uid + ] + [Desc TransactionDateTime] let profitquery = "select \ min(date(date_time at time zone 'utc')) as date,\ sum(CASE WHEN NOT trans_is_sell THEN quantity*price_cents ELSE 0 END) :: bigint as buy,\