Laravel不同的分页输出

时间:2018-07-12 14:41:41

标签: laravel-5.4

我有这个查询:

$meetings = DB::table('meetings')->where('date', '>=', $todayTs)->orWhere('date',0)->paginate(1);

给我这个结果:

enter image description here

然后我有这个查询:

$meetings = DB::table('meetings')->where([
    ['occasion',$filterOptions->occasion_leisure],
])->whereIn('lookingfor',$type)->orWhere([
    ['occasion',$filterOptions->occasion_party]
])->whereIn('lookingfor',$type)->orWhere([
    ['occasion',$filterOptions->occasion_sport]
])->whereIn('lookingfor',$type)->orWhere([
    ['occasion',$filterOptions->occasion_travel]
])->whereIn('lookingfor',$type)->orWhere([
    ['occasion',$filterOptions->occasion_other]
])->whereIn('lookingfor',$type)->paginate(1);

给我这个结果:

enter image description here

我不明白为什么第二个查询返回一个LengthAwarePaginator(我需要),而第一个查询却没有。我需要对两个结果进行分页,但是由于结果不同,因此我很难做到。

0 个答案:

没有答案