Propel ORM: Order By FIELD
问题 I'm trying to do a query with a custom "order by" with Propel 1.6 select * from myObject ORDER BY FIELD(id, 3, 11, 7, 1) this does not work: myObjectQuery::create() ->orderById($someIds) ->find() how can i do? 回答1: you can stack order-by's in order that you want: myObjectQuery::create() ->orderByField1 ->orderbyField3('desc') ->orderbyField2 ->find() Try that. Update 2: $con = Propel::getConnection(); $query = 'SELECT COUNT(t1.user) AS users, t1.choice AS lft, t2.choice AS rgt FROM choice t1