$query .= ' ORDER BY cc.ordering, a.created DESC' ;

dovrebbe servire allo scopo.