这件事发生在我身上。我的代码如下:
$state_image =States_Images::where('id_state', $id);
echo $delete_path=$state_image->name;
结果是:
Undefined property: Illuminate\Database\Eloquent\Builder::$name
有人帮我说:(
答案 0 :(得分:5)
您需要使用get()或first()完成查询。在你的情况下可能:
lists = [Everton, Liverpool, Villa]
queryset = Betting.objects.filter(matches__in=list)