sort users by ident
This commit is contained in:
parent
99bf138a92
commit
e0212febfc
1 changed files with 19 additions and 17 deletions
|
@ -68,23 +68,25 @@ 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
|
||||||
ts .>= C.constant (addDays (-30) today)
|
AllUsers ->
|
||||||
) <<< queryTable userTable
|
C.constant True
|
||||||
OldUsers -> keepWhen (\(_, _, _, ts, _, _) ->
|
ActiveUsers ->
|
||||||
ts .<= C.constant (addDays (-30) today)
|
ts .>= C.constant (addDays (-30) today)
|
||||||
) <<< queryTable userTable
|
OldUsers ->
|
||||||
) :: MateHandler
|
ts .< C.constant (addDays (-30) today)
|
||||||
[ ( Int
|
) <<< selectTable userTable)
|
||||||
, Text
|
) :: MateHandler
|
||||||
, Int
|
[ ( Int
|
||||||
, Day
|
, Text
|
||||||
, Maybe Text
|
, Int
|
||||||
, Maybe Int
|
, Day
|
||||||
)
|
, Maybe Text
|
||||||
]
|
, Maybe Int
|
||||||
|
)
|
||||||
|
]
|
||||||
mapM
|
mapM
|
||||||
(\(i1, i2, _, _, _, i6) -> return $
|
(\(i1, i2, _, _, _, i6) -> return $
|
||||||
UserSummary i1 i2 i6
|
UserSummary i1 i2 i6
|
||||||
|
|
Loading…
Reference in a new issue