我是 CakePHP 的新手,现在我无法转换查询:
SELECT *,
MATCH (title, post, tags) AGAINST ('dialux' IN BOOLEAN MODE) as REL
FROM posts
WHERE MATCH (title, post, tags) AGAINST ('dialux' IN BOOLEAN MODE)
ORDER BY REL DESC;
在这样的内容中:
$this->Post->find('all', xxx);
有什么想法吗?谢谢。
不确定这是否有帮助,因为它来自 mark 已经建议的页面
但是你可以尝试这样的事情:
$query = 'SELECT *,
MATCH (title, post, tags) AGAINST ('dialux' IN BOOLEAN MODE) as REL
FROM posts
WHERE MATCH (title, post, tags) AGAINST ('dialux' IN BOOLEAN MODE)
ORDER BY REL DESC;';
$this->Post->query($query);