Browse Source

Исправление ошибки в SqlCriteria.count() для запросов в которых есть свой индивидуальный select и groupby (fix1)

namespace
Alexander Demidov 10 years ago
parent
commit
bccd018530
  1. 2
      Model/SqlCriteria.php

2
Model/SqlCriteria.php

@ -88,7 +88,7 @@ class SqlCriteria
$this->sql_expression = 'SELECT COUNT(' . ($select ? $select : '*') . ') as count FROM :table'; $this->sql_expression = 'SELECT COUNT(' . ($select ? $select : '*') . ') as count FROM :table';
$select = 'x.count'; $select = 'x.count';
} }
$count = $this->model->count($this->where, null, $this->group_by, $this->sql_expression, $this->sql_expression_params)->fetchField('count');
$count = $this->model->count($select, $this->where, null, $this->group_by, $this->sql_expression, $this->sql_expression_params)->fetchField('count');
$this->sql_expression = $sql_expression_backup; $this->sql_expression = $sql_expression_backup;
return $count; return $count;
} }

Loading…
Cancel
Save