In AC this order works great, but Query builder make quotes wrong, result error
$models = Yii::app()->db->createCommand()
->select('id, user_id, title, created, modified, lang, forum_id, post_id, status, views, replies, attached')
->from('posts')
->where('post_id = 0')
->order('attached AND forum_id = 1 AND created DESC, created DESC')
->limit(11)
->queryAll();
error:
CDbCommand не удалось исполнить SQL-запрос: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'attached AND forum_id = 1 AND created' in 'order clause'. The SQL statement executed was: SELECT
id
,user_id
,title
,created
,modified
,lang
,forum_id
,post_id
,status
,views
,replies
,attached
FROMposts
WHERE post_id = 0 ORDER BYattached AND forum_id = 1 AND created
DESC,replies
DESC,created
DESC LIMIT 11
how to fix it?
P.S. Sorry for my English.