title: Adding pagination in cakephp with multiple join tables and conditions
body: <p>here $qoptions contains the conditions according to which data is fetched from different tables and $tmp is basically the query which is getting diff fields value from different tables. Now where should I add pagination .. If i add acccording to user table result than am not getting correct pagination result according to my data.</p>
  
  <pre><code>            $tmp=$this-&gt;User-&gt;find('all', 
           array(
             'fields' =&gt; array('User.id', 'User.name','user_details.designation','districts.district_name','User.user_type','User.phone','user_details.annual_frequency','areas.area_name') ,
             'joins' =&gt; array(array('table' =&gt; 'user_details',
                                     'alias' =&gt; 'user_details',
                                     'type' =&gt; 'INNER',
                                     'conditions' =&gt; array('User.id = user_details.user_id AND user_details.annual_frequency&gt;0')
                               ),
                     array('table' =&gt; 'areas',
                                     'alias' =&gt; 'areas',
                                     'type' =&gt; 'INNER',
                                     'conditions' =&gt; array('User.area_id = areas.id')
                               ),
                    array('table' =&gt; 'districts',
                                     'alias' =&gt; 'districts',
                                     'type' =&gt; 'INNER',
                                     'conditions' =&gt; array('areas.district_id = districts.id')
                               )
  
          ),
                  'conditions' =&gt; $qOptions,  
  
               )
        );         $this-&gt;paginate = ($tmp)
               $p = $this-&gt;paginate('User');
  </code></pre>