我无法使用查询构建器在laravel中编写此查询:
```
SELECT pt.name, IF(up.permission_id IS NULL,'false','true') permission
FROM mercuri_permission_type pt
LEFT OUTER JOIN mercuri_user_permission up
ON pt.id = up.permission_id AND up.user_id = $user_id
```
答案 0 :(得分:0)
你应该做多left join
来处理这个问题;但我建议你使用doctrine ORM并在doctrine上运行这个查询。为了在Laravel中使用Doctrine,下面的链接很有用:
Getting started doctrine 2 laravel