sort users by ident

This commit is contained in:
nek0 2019-11-01 00:00:41 +01:00
parent 99bf138a92
commit e0212febfc

View file

@ -68,14 +68,16 @@ userSelect
-> MateHandler [UserSummary]
userSelect ref conn = do
today <- utctDay <$> liftIO getCurrentTime
users <- liftIO $ runSelect conn (case ref of
AllUsers -> selectTable userTable
ActiveUsers -> keepWhen (\(_, _, _, ts, _, _) ->
users <- liftIO $ runSelect conn (
orderBy (asc (\(_, ident, _, _, _, _) -> ident)) (
keepWhen (\(_, _, _, ts, _, _) -> case ref of
AllUsers ->
C.constant True
ActiveUsers ->
ts .>= C.constant (addDays (-30) today)
) <<< queryTable userTable
OldUsers -> keepWhen (\(_, _, _, ts, _, _) ->
ts .<= C.constant (addDays (-30) today)
) <<< queryTable userTable
OldUsers ->
ts .< C.constant (addDays (-30) today)
) <<< selectTable userTable)
) :: MateHandler
[ ( Int
, Text