how to construct query that joing two tables from Model in zend framework
I have two tables 'country' and 'destination'. And i want to write a query which goes like this from Destination Model
select destina开发者_如何学Pythontion.*, country.name from destination inner join country on destination.country_id = country.id;
Try:
$this->select('destination.*', 'country.name')->from->('destination')->joinInner('country', '`destination`.`country_id` = `country`.`id`')->setIntegrityCheck(false)->query();
精彩评论