mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-06 11:32:40 +00:00
Fixing 'ambiguous column' bug in Model::findCount()
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4592 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
8131f2a55c
commit
3b0a6bf5d4
1 changed files with 1 additions and 1 deletions
|
@ -1491,7 +1491,7 @@ class Model extends Overloadable {
|
|||
* @see Model::findAll
|
||||
*/
|
||||
function findCount($conditions = null, $recursive = 0) {
|
||||
list($data) = $this->findAll($conditions, 'COUNT(*) AS count', $this->primaryKey, null, 1, $recursive);
|
||||
list($data) = $this->findAll($conditions, 'COUNT(*) AS count', $this->escapeField(), null, 1, $recursive);
|
||||
|
||||
if (isset($data[0]['count'])) {
|
||||
return $data[0]['count'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue