如何将此查询转换为Eloquent?

时间:2016-10-20 17:15:42

标签: laravel eloquent

If you want to run jackd with realtime priorities, the user starting jackd
needs realtime permissions. Accept this option to create the file
/etc/security/limits.d/audio.conf, granting realtime priority and memlock
privileges to the audio group.

Running jackd with realtime priority minimizes latency, but may lead to
complete system lock-ups by requesting all the available physical system
memory, which is unacceptable in multi-user environments.

Enable realtime process priority? [yes/no]

我试试这个,但数据不正确。

select ass.pessoa_id, r1.id from assinatura as ass
inner join relatorio_grupo rp on rp.id = ass.relatorio_grupo_id
inner join relatorio r1 on r1.grupo_id = rp.id
left join relatorio_excecao r on r.pessoa_id = ass.pessoa_id and r1.id = r.relatorio_id
where r.id is null and ass.pessoa_id = 2

1 个答案:

答案 0 :(得分:0)

您似乎需要在第三个声明中使用leftJoin而不是join

leftJoin('relatorio_excecao','relatorio_excecao.pessoa_id','=','assinatura.pessoa_id and relatorio.id = relatorio_excecao.id','left',true)