You need to add the foreign key that relates User to Addition into the
fields array.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To u
I have this:
User Model
$q = $this->find('first', array(
'conditions' => array(
'User.id' => $auth_id),
//'fields' => array('User.id'),
'contain' => array(
'Addition' => array(
'conditions' => array('Addition.id' => $auth_id),
'fields' => array(
$this->paginate['Group'] = $parametros; near the end is $this->paginate
['Group'] = $parameters;
On May 28, 8:39 pm, Xoubaman wrote:
> User HABTM Group
> Group HABTM User
>
> When calling pagination I get these queries:
>
> SELECT COUNT(*) AS `count` FROM `groups` AS `Group` INNER JOIN
> `groups
User HABTM Group
Group HABTM User
When calling pagination I get these queries:
SELECT COUNT(*) AS `count` FROM `groups` AS `Group` INNER JOIN
`groups_users` AS `GroupsUser` ON (`GroupsUser`.`group_id` =
`Group`.`id` AND `GroupsUser`.`user_id` = 1) WHERE 1 = 1
SELECT `Group`.`id`, `Group`.`name`