lundi 3 septembre 2018

Helpe me to convert SQL query to Laravel eloquent

I have this SQL query:

SELECT *, count(*) as mostView FROM users RIGHT JOIN visitors ON users.id = visitors.user_id GROUP BY users.id HAVING users.isActive=1 AND users.fullName IS NOT NULL AND users.photo_id IS NOT NULL AND users.role_id IN(1, 3) ORDER BY mostView DESC LIMIT 5

It works, but I need convert to Laravel eloquent, i'm using laravel 5.6, could any one helpe me thanks in advance



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire