thinkphp3.2 3表联合查询

$travel = M(‘Travel’);
$data = $travel->join(‘zq_member on zq_travel.tl_publish = zq_member.mb_id’, ‘left’)->join(‘zq_diqu on zq_travel.tl_diqu = zq_diqu.dq_id’, ‘left’)->select();

//连表的数量
c o u n t = c o u n t ( count = count( count=count(info);
$this->assign(‘count’, $count);

//左连
$manager = M(‘Manager’);
$info = $manager->join(‘LEFT JOIN zq_member on zq_manager.mg_member = zq_member.mb_id’)->select();

zq_manager表 左连 zq_member 表

你可能感兴趣的:(thinkphp)