mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Fixed syntax errors from SQLQuery/DataQuery cleanup
This commit is contained in:
parent
4da9e72eed
commit
8f2ede8fcf
@ -325,7 +325,7 @@ class DataQuery {
|
|||||||
* @param String $field Unquoted database column name (will be escaped automatically)
|
* @param String $field Unquoted database column name (will be escaped automatically)
|
||||||
*/
|
*/
|
||||||
function Max($field) {
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -334,7 +334,7 @@ class DataQuery {
|
|||||||
* @param String $field Unquoted database column name (will be escaped automatically)
|
* @param String $field Unquoted database column name (will be escaped automatically)
|
||||||
*/
|
*/
|
||||||
function Min($field) {
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -343,7 +343,7 @@ class DataQuery {
|
|||||||
* @param String $field Unquoted database column name (will be escaped automatically)
|
* @param String $field Unquoted database column name (will be escaped automatically)
|
||||||
*/
|
*/
|
||||||
function Avg($field) {
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -352,7 +352,7 @@ class DataQuery {
|
|||||||
* @param String $field Unquoted database column name (will be escaped automatically)
|
* @param String $field Unquoted database column name (will be escaped automatically)
|
||||||
*/
|
*/
|
||||||
function Sum($field) {
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -848,7 +848,7 @@ class SQLQuery {
|
|||||||
else $filter = "(" . implode(") AND (", $join['filter']) . ")";
|
else $filter = "(" . implode(") AND (", $join['filter']) . ")";
|
||||||
|
|
||||||
$aliasClause = ($alias != $join['table']) ? " AS \"" . Convert::raw2sql($alias) . "\"" : "";
|
$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";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user