sort users by ident
This commit is contained in:
parent
173c4f4ee7
commit
49d0aa9528
1 changed files with 19 additions and 17 deletions
|
@ -68,14 +68,16 @@ userSelect
|
||||||
-> MateHandler [UserSummary]
|
-> MateHandler [UserSummary]
|
||||||
userSelect ref conn = do
|
userSelect ref conn = do
|
||||||
today <- utctDay <$> liftIO getCurrentTime
|
today <- utctDay <$> liftIO getCurrentTime
|
||||||
users <- liftIO $ runSelect conn (case ref of
|
users <- liftIO $ runSelect conn (
|
||||||
AllUsers -> selectTable userTable
|
orderBy (asc (\(_, ident, _, _, _, _) -> ident)) (
|
||||||
ActiveUsers -> keepWhen (\(_, _, _, ts, _, _) ->
|
keepWhen (\(_, _, _, ts, _, _) -> case ref of
|
||||||
|
AllUsers ->
|
||||||
|
C.constant True
|
||||||
|
ActiveUsers ->
|
||||||
ts .>= C.constant (addDays (-30) today)
|
ts .>= C.constant (addDays (-30) today)
|
||||||
) <<< queryTable userTable
|
OldUsers ->
|
||||||
OldUsers -> keepWhen (\(_, _, _, ts, _, _) ->
|
ts .< C.constant (addDays (-30) today)
|
||||||
ts .<= C.constant (addDays (-30) today)
|
) <<< selectTable userTable)
|
||||||
) <<< queryTable userTable
|
|
||||||
) :: MateHandler
|
) :: MateHandler
|
||||||
[ ( Int
|
[ ( Int
|
||||||
, Text
|
, Text
|
||||||
|
|
Loading…
Reference in a new issue