php - (SOLVED) Little issue with Yii CDbCriteria Joins -


I have the following tables aliados (trying to recover the archive from the main table and i) aliados_direccion whose aliados_id is a The foreign key is in the form of aliados_centro_medico which also has aliados_id as a foreign key and could possibly make many UK connections with the following table. centro_medico

aliados_direccion and centro_medico have a column called "parroquias_id" which comes from a separate table that does not have any value for this query.

I grid depends on me on some of the "Aliados" show if they aliados_direccion or pertaining to a aliados_centro_medico where aliados_direccion.parroquias_id or centro_medico.parroquias_id an array that user logs in that is.

The array is fine and mysql reads it without any problem, the issue is in the actual query.

  $ criteria = new cdccitrea; $ Benchmarking & gt; Selection = 'one *.'; $ Benchmarking & gt; Aka = 'one'; $ Benchmarking & gt; '. (From the Aliados_direccion dir, select' IN dir.parroquias_id dir *. ') Joining ad.aliados_id = a.id ad on' $ zonas. '). $ Benchmarking & gt; = Join me on many cm.idCM = 'authority (select multiple * of aliados_centro_medico many inner JOIN (centro_medico.id idCM as selected by OU (in centro_medico.parroquias_id centro_medico involved in.' $ Zonas ')) ..centro_medico_id) acm.mAlId = a.id' on acm; $ Benchmarking & gt; Comparison (blahblahblah); // BTW $ zonas is the array I created earlier   

Here's what the grid will show me all the records or anyone, depending on whether I am left or right ($ This-> aliados_direccion) {// Join first criterion elseif ($ this-> aliados_centro_medico) {// Join other criteria I like & gt also tried to use the nickname of the relationship,}

But when I do this, it still has me all the records Bring, even if do I use instead of Inner.