$q = new CDbCriteria(array(
'scopes' => 'notOwnedByUser',
'select' => '*, (MATCH (tbl_book_ftsearch.title, tbl_book_ftsearch.description) AGAINST ('*$match*')) AS SCORE',
'join' => 'LEFT JOIN tbl_book_ftsearch ON t.id = tbl_book_ftsearch.id',
'condition' => "LOWER(author) LIKE :match OR LOWER(publisher) LIKE :match OR MATCH (tbl_book_ftsearch.title, tbl_book_ftsearch.description) AGAINST ('*$match*' IN BOOLEAN MODE)",
'order' => 'score DESC',
'params' => array(':match' => "%$match%")
));Quote
[system.db.CDbCommand] CDbCommand::fetchAll() failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'score' in 'order clause'. The SQL statement executed was: SELECT 0 FROM `tbl_book` `t` LEFT JOIN tbl_book_ftsearch ON t.id = tbl_book_ftsearch.id WHERE (t.id NOT IN (SELECT book_id FROM tbl_user_book WHERE tbl_user_book.user_id = :user_id)) AND (LOWER(author) LIKE :match OR LOWER(publisher) LIKE :match OR MATCH (tbl_book_ftsearch.title, tbl_book_ftsearch.description) AGAINST ('*fdgsfdg*' IN BOOLEAN MODE)) ORDER BY score DESC. Bound with :user_id='2', :match='%fdgsfdg%'.
I'm doing something wrong or is it a bug?
Thanks

Help













