【发布时间】:2021-03-24 12:37:52
【问题描述】:
我有 3 个表,即 Resort、Booking、Expense,这些表是通过关系连接的。代码如下,
$resorts = Resort::where('status',1)->with('bookings')->withSum('bookings', 'amount')
->with('expenses')->withSum('expenses', 'amount')->get();
我想使用date 字段对该表进行排序。如何在此查询中使用 wherebetween 进行预订和费用?
【问题讨论】: