Convert mySql to cakephp 3.5


#1

Dear Gurus,

I need help to convert Mysql query into cakephp 3.5. The query is for calculate player ranking base on column “points”. I test the query and work fine but I dont have the expertise to convert to ORM query builder cake.

SELECT *, FIND_IN_SET(points,
(SELECT GROUP_CONCAT(DISTINCT points ORDER BY points DESC)
FROM view_ent_users)) as rank
FROM view_ent_users
WHERE nickname = ‘Sebass’
ORDER BY points DESC

This is the query:

Thanks,