- foreach ($this->order as &$item) {
- if ($item{0} == '-') {
- $item = substr($item, 1) . ' DESC';
+ $order = Env::v('order', $this->defaultkey);
+ $invert = ($order{0} == '-');
+ if ($invert) {
+ $order = substr($order, 1);
+ }
+ $list = array();
+ foreach ($this->sortkeys[$order]['keys'] as $item) {
+ $desc = ($item{0} == '-');
+ if ($desc) {
+ $item = substr($item, 1);