用于合并 laravel 中的三个表的连接查询
join query for merging three tables in laravel
我想根据 department_string_id 加入部门 table 的项目 table 并加入项目 table 和 project_owner_id 的用户 table用户 table 条件 project.project_owner_id=users.aceid
desired query (working fine)
select p.*,d.department_head_aceid from project as p inner join department as d on p.department_string_id=d.department_string_id inner join users as u on p.project_owner_id=u.aceid where u.id='4'
Laravel查询
$approver_id_roles=DB::table('project')
->join('department', 'project.department_string_id', '=', 'department.department_string_id')->join('users','project.project_owner_id','=','users.aceid')
->where('project.project_owner_id','=','users.aceid')
->select('department.department_head_aceid')->get();
发现以下错误
TokenMismatchException in VerifyCsrfToken.php line 68:
我这里做错了什么
为了避免 CSRF 攻击,我们希望在表单中添加令牌。
Laravel token
<input type="hidden" name="_token" value="{{ csrf_token() }}">
我想根据 department_string_id 加入部门 table 的项目 table 并加入项目 table 和 project_owner_id 的用户 table用户 table 条件 project.project_owner_id=users.aceid
desired query (working fine)
select p.*,d.department_head_aceid from project as p inner join department as d on p.department_string_id=d.department_string_id inner join users as u on p.project_owner_id=u.aceid where u.id='4'
Laravel查询
$approver_id_roles=DB::table('project')
->join('department', 'project.department_string_id', '=', 'department.department_string_id')->join('users','project.project_owner_id','=','users.aceid')
->where('project.project_owner_id','=','users.aceid')
->select('department.department_head_aceid')->get();
发现以下错误
TokenMismatchException in VerifyCsrfToken.php line 68:
我这里做错了什么
为了避免 CSRF 攻击,我们希望在表单中添加令牌。 Laravel token
<input type="hidden" name="_token" value="{{ csrf_token() }}">