Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我宁愿试图弄清楚如何将其作为来自数据库的单个查询运行,而不是使用一个查询获取结果然后执行另一个查询。
$query->whereIn('page_user_id', Staff::lists('staff_id'));
谢谢您的帮助
$query->join('staff', 'staff.staff_id', '=', 'user.page_user_id')->get();
我认为这会有所帮助。以供参考http://laravel.com/docs/5.1/queries
http://laravel.com/docs/5.1/queries