我正在尝试使用以下代码在 CakePHP 2 应用程序中实现自定义排序顺序:
var $paginate = array(
'Project' => array(
'conditions' => array('Project.deleted' => 0),
'order' => array(
'Project.pinned' => 'desc',
'FIELD(Project.status, 1, 3, 4, 0, 2) DESC'
'Project.date_start' => 'asc',
'Project.name' => 'asc',
),
),
);
但是,由于某种原因FIELD(Project.status, 1, 3, 4, 0, 2) DESC
被 Cake 忽略了。你能帮我让它工作吗?