【发布时间】:2014-05-18 15:42:55
【问题描述】:
我有一个包含多个子查询的查询,其中包含我试图在 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)
)
我真的不确定将哪些方法链接在一起来构建它。任何帮助将不胜感激。
【问题讨论】: