php部分
$related = articles::where('title','like','%'.$title.'%')
->where('id','<>',$id)
->groupBy('id')
->limit($count)
->get();
html部分
@foreach($related as $relate)
{{$relate->title}} //类似于这样
@endforeach
php部分
$related = articles::where('title','like','%'.$title.'%')
->where('id','<>',$id)
->groupBy('id')
->limit($count)
->get();
html部分
@foreach($related as $relate)
{{$relate->title}} //类似于这样
@endforeach
转载于:https://www.cnblogs.com/aiit/p/7144131.html