lie2815
(Franz)
1
Hey folks,
I have this query:
$cities = City::model()->with('confirmedCount', 'unconfirmedCount')->findAll();
Both ‘confirmedCount’ and ‘unconfirmedCount’ are stat relationships.
How can I sort by confirmedCount?
My experimenting so far made me think this is not possible?
Thanks in advance!
iivano71
(Igor Zg1987)
2
in relation confirmedCount in array of model relations you have to add eg ‘order’=>‘confirmedCount.id ASC’
lie2815
(Franz)
3
But I don’t always want to do that with every query for confirmedCount.
I have one query that fetches the confirmedCount for each city, and now I want to order the cities by their confirmedCount.