我有2个查询,我想知道第一个查询(dateincal)中存在的第二个查询的元素(date_debut)。第二个查询的元素可以在第一个查询中出现一次或多次。一旦找到日期(首次亮相)(dateincal),我希望能够再检索找到的元素的其他信息
$feries = Jourferie::Select('dateincal', 'description')
->where('dateincal', '>=', Carbon::now()->startOfMonth())
->where('dateincal', '<=', Carbon::now()->endOfMonth())
->get();
$plannings = Planning::Select('date_debut', 'id', 'agent_id', 'site_id')
->where('id', '!=', 0)
->where('statut', 'provisoire')
->get();
foreach($feries as $ferie){
$myresult = $plannings->contains('date_debut',$ferie->dateincal)
/* do things */
}