我有两个表'country'和'destination'。我想在Destination Model
中编写一个类似的查询select destination.*, country.name from destination inner join country on destination.country_id = country.id;
答案 0 :(得分:1)
尝试:
$this->select('destination.*', 'country.name')->from->('destination')->joinInner('country', '`destination`.`country_id` = `country`.`id`')->setIntegrityCheck(false)->query();