将原始查询翻译为cakephp

时间:2017-06-28 15:32:52

标签: sql cakephp-2.0

可以请任何人告诉我如何将这个原始查询转换为Cakephp 2.x

SELECT idUser, email, username, 
    (select count(room.idRoom)  FROM room as room where winner1 = user.idUser or winner2 = user.idUser) as t
    FROM 
    PRODB.user as user
    order by t desc
    ;

1 个答案:

答案 0 :(得分:0)

在cakephp中我们必须将原始查询添加为内联..我希望这可能对您有所帮助。

sudo python whatever.py