forgot to filter by user-id in wallet -.-
This commit is contained in:
parent
0e007371d4
commit
1cc0962528
@ -52,7 +52,11 @@ getWalletR = getWalletDetailsR 6 7
|
|||||||
getWalletDetailsR :: Int64 -> Int64 -> Handler Html
|
getWalletDetailsR :: Int64 -> Int64 -> Handler Html
|
||||||
getWalletDetailsR hrs days = loginOrDo (\(uid,user) -> do
|
getWalletDetailsR hrs days = loginOrDo (\(uid,user) -> do
|
||||||
now <- liftIO getCurrentTime
|
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 \
|
let profitquery = "select \
|
||||||
min(date(date_time at time zone 'utc')) as date,\
|
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,\
|
sum(CASE WHEN NOT trans_is_sell THEN quantity*price_cents ELSE 0 END) :: bigint as buy,\
|
||||||
|
Loading…
Reference in New Issue
Block a user