$query = \DB::table("public.users")->join("branches",function($join){$join->on("branches.id", "=", "users.branch_id");})->get;
dd($query());
调用未定义的方法Illuminate \ Database \ Query \ Builder :: join(“ branches”,“ branches.id”,“ users.branch_id”)-> get()
大型展示查询结果
答案 0 :(得分:0)
try to remove public from the query.
$query = \DB::table("users")->join("branches",function($join){$join-
on(“ branches.id”,“ =”,“ users.branch_id”);})-> get;
答案 1 :(得分:0)
$query = DB::table('users')
->join('contacts', 'users.id', '=', 'contacts.user_id')
->get();