还是关于laravel 5.4很困惑,因为我是新来这检查数据,我想从记录表谁得到了相同的年和当然获取数据的行与用户。Laravel 5.4 - 从另一个表
$show = Profile::where('userid','=',$id)->first();
$check1 = Record::where([['year','=',$show->year],['course','=',$show->course]])->get();
它成功运行,并能够获得人员名单。现在,我接下来要做的是检查这些人员列表($ check1的结果)是否存在于名为Fbuser的另一个表上。试着这样做,
$check2 = Fbuser::where([['first_name','=',$check1->firstname],['last_name','=',$check1->lastname]]);
if ($check2 === null) {
return 'recommend';
} else {
return 'exit';
}
但它给了我一个错误
(1/1)异常 属性[名字]不会对这种集合实例存在。
有没有什么办法可以解决这个问题? 在此先感谢。
什么是表Fbuser字段名称? –