Skip to content

Commit

Permalink
MINOR Fixed syntax errors from SQLQuery/DataQuery cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
chillu committed May 16, 2012
1 parent 4da9e72 commit 8f2ede8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions model/DataQuery.php
Expand Up @@ -325,7 +325,7 @@ function count() {
* @param String $field Unquoted database column name (will be escaped automatically)
*/
function Max($field) {
return $this->getFinalisedQuery()->aggregate(sprintf('MAX("%s")', Convert::raw2sql($field))->execute()->value();
return $this->getFinalisedQuery()->aggregate(sprintf('MAX("%s")', Convert::raw2sql($field)))->execute()->value();
}

/**
Expand All @@ -334,7 +334,7 @@ function Max($field) {
* @param String $field Unquoted database column name (will be escaped automatically)
*/
function Min($field) {
return $this->getFinalisedQuery()->aggregate(sprintf('MIN("%s")', Convert::raw2sql($field))->execute()->value();
return $this->getFinalisedQuery()->aggregate(sprintf('MIN("%s")', Convert::raw2sql($field)))->execute()->value();
}

/**
Expand All @@ -343,7 +343,7 @@ function Min($field) {
* @param String $field Unquoted database column name (will be escaped automatically)
*/
function Avg($field) {
return $this->getFinalisedQuery()->aggregate(sprintf('AVG("%s")', Convert::raw2sql($field))->execute()->value();
return $this->getFinalisedQuery()->aggregate(sprintf('AVG("%s")', Convert::raw2sql($field)))->execute()->value();
}

/**
Expand All @@ -352,7 +352,7 @@ function Avg($field) {
* @param String $field Unquoted database column name (will be escaped automatically)
*/
function Sum($field) {
return $this->getFinalisedQuery()->aggregate((sprintf('SUM("%s")', Convert::raw2sql($field)))->execute()->value();
return $this->getFinalisedQuery()->aggregate(sprintf('SUM("%s")', Convert::raw2sql($field)))->execute()->value();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion model/SQLQuery.php
Expand Up @@ -848,7 +848,7 @@ function sql() {
else $filter = "(" . implode(") AND (", $join['filter']) . ")";

$aliasClause = ($alias != $join['table']) ? " AS \"" . Convert::raw2sql($alias) . "\"" : "";
$this->from[$alias] = strtoupper($join['type']) . " JOIN \"{" . Convert::raw2sql($join['table']) . "}\"$aliasClause ON $filter";
$this->from[$alias] = strtoupper($join['type']) . " JOIN \"" . Convert::raw2sql($join['table']) . "\"$aliasClause ON $filter";
}
}

Expand Down

0 comments on commit 8f2ede8

Please sign in to comment.