tp5 thinkphp5 多表关联查询 join查询

model下:

$res = \think\Db::name('article')
->alias("a") //取一个别名
->join('admin ad','a.aid = ad.admin_id')
->field('a.aid,ad.admin_id ')
->select();

转载于:https://www.cnblogs.com/qcjdp/p/10837635.html

你可能感兴趣的:(php)