Cakephp $this->paginate with custom JOIN and filtering options


I've been working with cakephp paginations options for 2 days. I need to make a INNER Joins to list a few fields, but I have to deal with search to filter results.
This is portion of code in which I deal with search options by $this->passedArgs

function crediti() {

    if(isset($this->passedArgs['Search.cognome'])) {

                $this->paginate['conditions'][]['Member.cognome LIKE'] = str_replace('*','%',$this->passedArgs['Search.cognome']);

        if(isset($this->passedArgs['Search.nome'])) {
                $this->paginate['conditions'][]['Member.nome LIKE'] = str_replace('*','%',$this->passedArgs['Search.nome']);


and after

$this->paginate = array(

            'joins' => array(array('table'=> 'reservations',
            'type' => 'INNER',
            'alias' => 'Reservation',
            'conditions' => array('Reservation.member_id =','Member.totcrediti > 0' ))),
            'limit' => 10);
        $this->Member->recursive = -1;
        $this->paginate['conditions'][]['Reservation.pagamento_verificato'] = 'SI';
        $this->paginate['fields'] = array('DISTINCT','Member.nome','Member.cognome','Member.totcrediti');
        $members = $this->paginate('Member');

INNER JOIN works good, but $this->paginations ignore every $this->paginate['conditions'][] by $this->passedArgs and I cannot have idea how I can work it out.
No query in debug, just the original INNER JOIN.
Can someone helps me ?
Thank you very much

No luck about it.
I've been dealing with this part of code for many hours.
If I use

if(isset($this->passedArgs['Search.cognome'])) {
                    $this->paginate['conditions'][]['Member.cognome LIKE'] = str_replace('*','%',$this->passedArgs['Search.cognome']);

$this->paginate['conditions'][]['Member.sospeso'] = 'SI';
        $this->Member->recursive = 0;
        $this->paginate['fields'] = array(
        $sospesi = $this->paginate('Member');

everything goes well, and from debug I receive the first condition and the conditions from $this->paginate['conditions'][]['Member.cognome LIKE'], as you can see
array $this->passedArgs

    [Search.cognome] => aiello

Array $this->paginate['conditions'][]
    [0] => Array
            [Member.cognome LIKE] => aiello

    [1] => Array
            [Member.sospeso] => NO

But, if I write the joins with paginate , $this->paginate['conditions'][] will ignore all the stuff, and give me from debug, just $this->paginate['conditions'][]['Reservation.pagamento_verificato'] = 'SI';
Another bit of information.
If I put all the stuff dealing with $this->paginate['conditions'][]['Reservation.pagamento_verificato'] = 'SI';
before the $this->paginate JOIN, nothing will be in $this->paginate['conditions'][].

Best Solution

This is an old question, so I'll just review how to do a JOIN in a paginate for others who got here from Google like I did. Here's the sample code from the Widget's Controller, joining a Widget.user_id FK to a column, only showing the current user (in conditions):

// Limit widgets shown to only those owned by the user.
$this->paginate = array(
    'conditions' => array('' => $this->Auth->user('id')),
    'joins' => array(
            'alias' => 'User',
            'table' => 'users',
            'type' => 'INNER',
            'conditions' => '`User`.`id` = `Widget`.`user_id`'
    'limit' => 20,
    'order' => array(
        'created' => 'desc'
$this->set( 'widgets', $this->paginate( $this->Widget ) );

This makes a query similar to:

SELECT widgets.* FROM widgets 
INNER JOIN users ON widgets.user_id = 
WHERE = {current user id}

And still paginates.

Related Question