Browse Source

alias aggregate column in query grammar.

Taylor Otwell 13 years ago
parent
commit
f6ef233d39
1 changed files with 1 additions and 1 deletions
  1. 1 1
      laravel/database/query/grammars/grammar.php

+ 1 - 1
laravel/database/query/grammars/grammar.php

@@ -93,7 +93,7 @@ class Grammar extends \Laravel\Database\Grammar {
 
 
 		if ($query->distinct and $column !== '*') $column = 'DISTINCT '.$column;
 		if ($query->distinct and $column !== '*') $column = 'DISTINCT '.$column;
 
 
-		return 'SELECT '.$query->aggregate['aggregator'].'('.$column.')';
+		return 'SELECT '.$query->aggregate['aggregator'].'('.$column.') AS '.$this->wrap('aggregate');
 	}
 	}
 
 
 	/**
 	/**