Browse Source

dataprovider: reset orderBy when counting

strict sql dbms like postgres would fail otherwise
tags/2.0.0-beta
Carsten Brandt 11 years ago
parent
commit
ced7ee1b8a
  1. 2
      framework/yii/data/ActiveDataProvider.php

2
framework/yii/data/ActiveDataProvider.php

@ -158,7 +158,7 @@ class ActiveDataProvider extends BaseDataProvider
throw new InvalidConfigException('The "query" property must be an instance of a class that implements the QueryInterface e.g. yii\db\Query or its subclasses.'); throw new InvalidConfigException('The "query" property must be an instance of a class that implements the QueryInterface e.g. yii\db\Query or its subclasses.');
} }
$query = clone $this->query; $query = clone $this->query;
return (int) $query->limit(-1)->offset(-1)->count($this->db); return (int) $query->limit(-1)->offset(-1)->orderBy([])->count($this->db);
} }
/** /**

Loading…
Cancel
Save