Nicássio Meneguci
unread,Jun 23, 2009, 9:27:30 PM6/23/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Cake PHP Português
Estou com um problema para fazer uma paginacao aplicando um filtro na
tabela telefones, no campo telefone
quando uso o método paginator, ele me retorna um erro dizendo que nao
encontrou o campo, e mostra o select, nele eu reparei que nao faz o o
left join na tabela telefones, somente na tabela agendas_telefones, eu
ja consegui fazer o relacionamento entre elas, pra me mostrar os
dados, mas quando uso o paginator
com a condicação não está dando certo.
alguem poderia me ajudar
segue a estrutura das tabelas:
obrigado
CREATE TABLE IF NOT EXISTS `agendas` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`agenda` varchar(60) NOT NULL,
`prioridade` int(11) NOT NULL DEFAULT '0',
`agendanatureza_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
AUTO_INCREMENT=3 ;
INSERT INTO `agendas` (`id`, `agenda`, `prioridade`,
`agendanatureza_id`) VALUES
(1, 'Loja de Armas do Beto', 1, 1),
(2, 'Cristal', 3, 2);
CREATE TABLE IF NOT EXISTS `agendas_telefones` (
`agendas_id` int(11) NOT NULL,
`telefones_id` int(11) NOT NULL,
PRIMARY KEY (`agendas_id`,`telefones_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `agendas_telefones` (`agendas_id`, `telefones_id`) VALUES
(1, 1),
(1, 2),
(2, 1),
(2, 2);
CREATE TABLE IF NOT EXISTS `telefones` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`telefone` varchar(13) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
INSERT INTO `telefones` (`id`, `telefone`) VALUES
(1, 'aaaaaaaaaaaaa'),
(2, 'aaaaaaaaaaaaa');