JOIN

ThinkPHP3.2.3查询多次JOIN同一张表的处理

问题: 在项目开发中遇到问题,要查询的一张主表post中有两个字段都关联了user表的id,需要取出user的user_name字段,那么应该怎么查询呢? 解决: $posts_list = M() ->table(‘gc_post P’) ->join(‘gc_user U ON P.author_id=U.id’) ->join(‘gc_user U_M ON P.mento […]

Scroll to top