Hello. I need a little help with CCv5.
I want to create a list of two related tables (attached picture) ...
Since MyAdmin I managed to do the query correctly:
query OK:
How I can make the same query from ccv5?... I have tried many ways to link (haveone, have many and belongto) left, right, inner ... but I have not got the tittle I need.
Debug copy and paste the result to the list closest I could get ... The configuration of the two tables in "haveone" foreign key "cd_idantiguo_traductor" other automatic settings.
Of course, in direct consultation I used fewer fields to speed the query.
TYVM!!!
javierp.
I want to create a list of two related tables (attached picture) ...
Since MyAdmin I managed to do the query correctly:
query OK:
SELECT `capacidad`.`cd_traductor` AS `capacidad.cd_traductor` , `capacidad`.`cd_servicio` AS `capacidad.cd_servicio` , `capacidad`.`it_jurado` AS `capacidad.it_jurado` , `names`.`id` AS `names.id` , `names`.`user_id` AS `names.user_id` , `names`.`firstname` AS `names.firstname` , `names`.`cb_idantiguo_traductor` AS `names.cb_idantiguo_traductor`
FROM `j4tyn_z_capacitaciones` AS `capacidad`
LEFT JOIN `j4tyn_comprofiler` AS `names` ON `capacidad`.`cd_traductor` = `names`.`cb_idantiguo_traductor`
LIMIT 0 , 30
How I can make the same query from ccv5?... I have tried many ways to link (haveone, have many and belongto) left, right, inner ... but I have not got the tittle I need.
Debug copy and paste the result to the list closest I could get ... The configuration of the two tables in "haveone" foreign key "cd_idantiguo_traductor" other automatic settings.
Array
(
[0] => SELECT `Extension`.`id` AS `Extension.id`, `Extension`.`name` AS `Extension.name` FROM `j4tyn_chronoengine_extensions` AS `Extension` WHERE `Extension`.`enabled` = '1' ORDER BY `Extension`.`ordering` ASC
[1] => SELECT `Connection`.`id` AS `Connection.id`, `Connection`.`title` AS `Connection.title`, `Connection`.`params` AS `Connection.params`, `Connection`.`extras` AS `Connection.extras`, `Connection`.`published` AS `Connection.published` FROM `j4tyn_chronoengine_connections` AS `Connection` WHERE `Connection`.`title` = 'capacitaciones_2' AND `Connection`.`published` = '1'
[2] => SELECT COUNT(`capacidad`.`id_cap`) AS `capacidad.count` FROM `j4tyn_z_capacitaciones` AS `capacidad` LEFT JOIN `j4tyn_comprofiler` AS `names` ON `capacidad`.`id_cap` = `names`.`cb_idantiguo_traductor` GROUP BY `capacidad`.`id_cap`
[3] => SELECT `capacidad`.`id_cap` AS `capacidad.id_cap`, `capacidad`.`cd_traductor` AS `capacidad.cd_traductor`, `capacidad`.`cd_servicio` AS `capacidad.cd_servicio`, `capacidad`.`fc_homologado` AS `capacidad.fc_homologado`, `capacidad`.`fc_deshomologado` AS `capacidad.fc_deshomologado`, `capacidad`.`it_homologado` AS `capacidad.it_homologado`, `capacidad`.`nm_descuento_tarifa` AS `capacidad.nm_descuento_tarifa`, `capacidad`.`nm_minimo` AS `capacidad.nm_minimo`, `capacidad`.`it_jurado` AS `capacidad.it_jurado`, `capacidad`.`nm_jurado` AS `capacidad.nm_jurado`, `capacidad`.`ds_firma_homo` AS `capacidad.ds_firma_homo`, `capacidad`.`ds_firma_deshomo` AS `capacidad.ds_firma_deshomo`, `capacidad`.`ds_motivo` AS `capacidad.ds_motivo`, `names`.`id` AS `names.id`, `names`.`user_id` AS `names.user_id`, `names`.`firstname` AS `names.firstname`, `names`.`cb_idantiguo_traductor` AS `names.cb_idantiguo_traductor` FROM `j4tyn_z_capacitaciones` AS `capacidad` LEFT JOIN `j4tyn_comprofiler` AS `names` ON `capacidad`.`id_cap` = `names`.`cb_idantiguo_traductor` GROUP BY `capacidad`.`id_cap` LIMIT 20
)
Of course, in direct consultation I used fewer fields to speed the query.
TYVM!!!
javierp.