Php 为什么公布的会议没有出现?
我有以下查询以获取已发布的会议:Php 为什么公布的会议没有出现?,php,laravel,Php,Laravel,我有以下查询以获取已发布的会议: $publishedConferences = $user->conferences()-> where(function ($query) { $query->where('status', '=', 'P'); $query->where('end_date','>', now()); })
$publishedConferences =
$user->conferences()->
where(function ($query) {
$query->where('status', '=', 'P');
$query->where('end_date','>', now());
})
->paginate($pageLimit);
dd($publishedConferences);
但是$publishedConferences显示:
LengthAwarePaginator {#345 ▼
#total: 1
#lastPage: 1
#items: Collection {#344 ▶}
#perPage: 5
#currentPage: 2
#path: "https://proj.test/user/profile"
#query: []
#fragment: null
#pageName: "page"
}
因此没有会议出现。然而,在数据库中,有一个会议的状态为“P”,而“结束日期”为“>now()”
你知道会有什么问题吗
显示已发布会议的HTML:
<div class="tab-pane fade show clearfix" id="publishedConferences" role="tabpanel"
aria-labelledby="home-tab">
<ul class="list-group">
@foreach($publishedConferences as $publishedConference)
@if(!empty($publishedConference))
<li class="list-group-item">
<p>{{$publishedConference->start_date->formatLocalized('%a, %b %d, %Y - %H:%M')}}</p>
<h5>{{$publishedConference->name}}</h5>
</li>
@endif
@endforeach
</ul>
<div class="text-center d-flex justify-content-center mt-3">
{{$publishedConferences->fragment('publishedConferences')->links("pagination::bootstrap-4")}}
</div>
</div>
@foreach($publishedConference作为$publishedConference)
@如果(!empty($publishedConference))
-
{{$publishedConference->start_date->formatLocalized(“%a,%b%d,%Y-%H:%M”)}
{{$publishedConference->name}
@恩迪夫
@endforeach
{{$publishedConferences->fragment('publishedConferences')->链接(“分页::引导-4”)}
将where子句更改为:
// or toDateTimeString() if needed for datetime type column
$query->where('end_date','>', now()->toDateString());