|
|
@ -80,7 +80,11 @@ class SqlCriteria |
|
|
|
|
|
|
|
public function count() |
|
|
|
{ |
|
|
|
if ($this->sql_expression && strpos($this->sql_expression, 'COUNT(*) as count')) { |
|
|
|
; |
|
|
|
} else { |
|
|
|
$this->sql_expression = 'SELECT COUNT(*) as count FROM :table'; |
|
|
|
} |
|
|
|
$this->defineJoinExpressions(); |
|
|
|
return $this->model->find(array(), '', $this->where, null, null, null, null, $this->sql_expression, $this->sql_expression_params)->fetchField('count'); |
|
|
|
} |
|
|
|