Db::field('user.name,role.ti
->table('think_user user,think_role role')
->limit(10)->select();
为了尽量避免和mysql的关键字冲突,可以建议使用数组方式定义,例如:
Db::field('user.name,role.ti
->table(['think_user'=>'user','think_role'=>'role'])
->limit(10)->select();
使用数组方式定义的优势是可以避免因为表名和关键字冲突而出错的情况。
最佳答案