Fixes #753: fixed sorting issue of ActiveDataProvider

This commit is contained in:
Qiang Xue
2013-08-13 07:46:04 -04:00
parent 5f4b59d024
commit d4c8f47c17

View File

@@ -153,7 +153,7 @@ class ActiveDataProvider extends DataProvider
$this->query->limit($pagination->getLimit())->offset($pagination->getOffset()); $this->query->limit($pagination->getLimit())->offset($pagination->getOffset());
} }
if (($sort = $this->getSort()) !== false) { if (($sort = $this->getSort()) !== false) {
$this->query->orderBy($sort->getOrders()); $this->query->addOrderBy($sort->getOrders());
} }
$this->_models = $this->query->all($this->db); $this->_models = $this->query->all($this->db);
} }