forgot to filter by user-id in wallet -.-

This commit is contained in:
Nicole Dresselhaus 2016-11-20 15:04:04 +01:00
parent 0e007371d4
commit 1cc0962528

View File

@ -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,\