Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » How to filter by a parent field in a link1 transaction
Re: How to filter by a parent field in a link1 transaction [message #1497 is a reply to message #1486] Thu, 17 July 2008 15:58 Go to previous messageGo to previous message
bonzo_bcn is currently offline  bonzo_bcn
Messages: 152
Registered: June 2008
Senior Member
So in calculated fields I can put 'fecini,fecfin' so that it retrieves two fields? I thought only one filed was possible.

I've defined the relationship between team and category to retrieve fecini, so now in the team_player_xref(link1).php.sql I have:
SELECT SQL_CALC_FOUND_ROWS equipo.*, categoria.fecini 
FROM equipo  LEFT JOIN categoria ON (categoria.categoria_id=equipo.categoria_id)  
WHERE ( equipo.equipo_id='2' ) AND equipo.entidad_id=2     LIMIT 1 OFFSET 0 =>Count=1

SELECT SQL_CALC_FOUND_ROWS equipo.equipo_id, participante.participante_id,
 CONCAT_WS(' ',participante.catsalut, participante.nombre, participante.apellido1,participante.apellido2) AS part_det, 
CASE WHEN part_equipo_xref.participante_id IS NULL THEN 'F' ELSE 'T' END AS selected 
FROM equipo  CROSS JOIN participante  
LEFT JOIN part_equipo_xref ON (equipo.equipo_id=part_equipo_xref.equipo_id 
AND participante.participante_id=part_equipo_xref.participante_id)    
WHERE equipo.equipo_id='2' AND participante.participante_id IN (SELECT participante_id FROM part_ent_xref WHERE entidad_id=2) LIMIT 10 OFFSET 0 =>Count=1


as you can see categoria.fecini is not in the final SQL of part_equipo_xref(link1).php.sql, I included this in class team_player_xref:
    function _cm_filterWhere ($array=null)
    // identify field names which are NOT to be filtered out of a $where string.
    {
        $array[] = 'fecini';

        return $array;

    } // _cm_filterWhere



How can I make fecini appear in the sql? I read the docs you pointed me to but didn't find it out.

[Updated on: Thu, 17 July 2008 16:45]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: override noedit on foreign field in multi2
Next Topic: How ro remove the 'page created in' message
Goto Forum:
  


Current Time: Wed Aug 07 01:21:39 EDT 2024

Total time taken to generate the page: 0.07428 seconds