Removed unnecessary duplication of columns in SearchContext SELECT clause

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@72006 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-02-18 09:06:15 +00:00
parent 2b972c45e7
commit 2f2d0c72b1

View File

@ -105,16 +105,12 @@ class SearchContext extends Object {
public function getQuery($searchParams, $sort = false, $limit = false, $existingQuery = null) {
$model = singleton($this->modelClass);
$fields = $this->applyBaseTableFields($model);
if($existingQuery) {
$query = $existingQuery;
} else {
$query = $model->buildSQL();
}
$query->select = array_merge($query->select,$fields);
$SQL_limit = Convert::raw2sql($limit);
$query->limit($SQL_limit);