简体   繁体   中英

How can I do a JOIN using cakephp's paginate method?

I have two tables that look like following:

RELEASE TABLE
name
asin


MATCHES TABLE
date
asin

I want to show a paginated page that shows all the RELEASES that have MATCHES. That is the asin column in RELEASE needs to match the asin column in MATCHES.

How would I do that using the paginate method assuming I have all the models included in my controller?

$this->paginate = array(
    'conditions' => array('not' => array('Release.match_id' => null))
);
$data = $this->paginate('Release');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM