我有一个查询,其中包含多个子查询,其中包含我试图在 Laravel 模型中构建的参数。
我对 Laravel 4 很陌生,所以我真的很想得到一些帮助,什么是“最好”的方法来做到这一点。
我需要重现的查询是:
Select userId from facultyAvailability
where
:startDate between startDate and endDate
and :endDate between startDate and endDate
and userId NOT IN(
Select
userId
from
schedulerTrialSchedule
inner join `review`
on eventId=lectureId
where
trialId = :trialId
and (
startDate between :startDate and :endDate
or endDate between :startDate and :endDate
)
)
AND userId IN (
SELECT userId
from
faculty2FacultyCategory
where
categoryId in(:categoryIdList)
)
我真的不确定将哪些方法链接在一起来构建它。任何帮助将不胜感激。