0
心中已經使用下面的函數從正點表中選擇最後一個ID,但它不是cocrrected如何在laravel5.0 eloqeunt關係中使用max id?
'loan'=>function($s) {
$s->with(['schedule'=>function($schedule){
$schedule->select(DB::raw('loan_id, schedule_date, principal as schedule_principal','max(id) as id'));
}]);
}]);