|
@ -81,9 +81,11 @@ class SqlCriteria |
|
|
|
|
|
|
|
|
public function count($select = 'x') |
|
|
public function count($select = 'x') |
|
|
{ |
|
|
{ |
|
|
|
|
|
$this->defineJoinExpressions(); |
|
|
$sql_expression_backup = $this->sql_expression; |
|
|
$sql_expression_backup = $this->sql_expression; |
|
|
|
|
|
if ($select) { |
|
|
$this->select( $select ); |
|
|
$this->select( $select ); |
|
|
$this->defineJoinExpressions(); |
|
|
|
|
|
|
|
|
} |
|
|
if (!$this->sql_expression) { |
|
|
if (!$this->sql_expression) { |
|
|
$this->sql_expression = 'SELECT COUNT(*) as count FROM :table'; |
|
|
$this->sql_expression = 'SELECT COUNT(*) as count FROM :table'; |
|
|
} |
|
|
} |
|
|