Yii Framework Forum: How to order by STAT type relation - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to order by STAT type relation Rate Topic: -----

#1 User is offline   juhe 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 26
  • Joined: 18-October 09

Posted 03 January 2010 - 01:32 PM

How to order by STAT relation? i.e.:

Post::model()->with('commentCount')->findAll(array('order' => 'commentCount ASC'));

I get column not found.


Thanks.
0

#2 User is offline   lucifurious 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 184
  • Joined: 15-March 09
  • Location:Atlanta, GA.

Posted 03 January 2010 - 02:13 PM

Try array('order'=>'1 asc' )
0

#3 User is offline   juhe 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 26
  • Joined: 18-October 09

Posted 04 January 2010 - 08:39 AM

This shouldn`t help. I turned on db query logging and commentCount is indeed not included in the select list. Any comments from core Yii guys?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users