我想要添加所有的loan_amort值,其中schedule is <= 30 days when schedule减去了当前日期。我该怎么做呢?以下是我的示例代码。我搞不懂whereRaw部分。请帮帮忙。谢谢。
$totalDues = Amortization::select('loan_type', \DB::raw('SUM(loan_amortization) as total_current'))
->where('payment_status',0)
->whereRaw('date_diff(schedule,now()) <= 30')
->groupBy('loan_type')
->orderBy('loan_type')
->get();发布于 2019-08-12 11:38:07
with td as
( select generate_series( now(), now()+interval '35 day', '1 day') schedule )
select date_part('day',schedule-now()) diff;我想对你来说这意味着
->whereRaw('date_part(''day'',schedule-now() <= 30')https://stackoverflow.com/questions/57446693
复制相似问题