R
R
Remsin2015-04-19 18:51:16
Laravel
Remsin, 2015-04-19 18:51:16

How to get all authorized users?

Hi all.
Can you please tell me how in Laravel 4.2 you can get a list (just id and name) of all users that meet two criteria - they are currently authorized and scored more than 100 points (where 'points' > 100)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Tarakhonich, 2015-04-20
@sofcase

You need to create a last_activity_at field and update it every N minutes i.e. so you can get active users at the current time. Then the query:
Where TIME is the timestamp with -N minutes from the current time.
N - this is actually the number of minutes after which you think that the user is now online.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question