aggregate() public method

Execute an aggregate function on the database.
public aggregate ( string $function, array $columns = ['*'] ) : mixed
$function string
$columns array
return mixed
Beispiel #1
0
 /**
  * Execute an aggregate function on the database.
  *
  * @param  string  $function
  * @param  array   $columns
  * @return mixed
  */
 public function aggregate($function, $columns = array('*'))
 {
     // Postgres doesn't like ORDER BY when there's no GROUP BY clause
     if (!isset($this->groups)) {
         $this->reOrderBy(null);
     }
     return parent::aggregate($function, $columns);
 }
Beispiel #2
0
 /**
  * Execute an aggregate function on the database.
  *
  * @param string $function
  * @param array $columns
  * @return float|int 
  * @static 
  */
 public static function aggregate($function, $columns = array())
 {
     return \Illuminate\Database\Query\Builder::aggregate($function, $columns);
 }