mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Fixing LIMIT clause for Model::find('first') (Ticket #3754)
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6178 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
60f4dd360d
commit
c9f59b8713
1 changed files with 2 additions and 0 deletions
|
@ -1524,6 +1524,8 @@ class Model extends Overloadable {
|
|||
$query['fields'] = 'COUNT(*) AS ' . $db->name('count');
|
||||
}
|
||||
$query['order'] = false;
|
||||
} elseif ($type == 'first') {
|
||||
$query['limit'] = 1;
|
||||
}
|
||||
|
||||
if (!is_numeric($query['page']) || intval($query['page']) < 1) {
|
||||
|
|
Loading…
Add table
Reference in a new issue