Laravel 8 orderByRaw
orderByRaw
方法可用于将原生字符串设置为 order by
语句的值:
$orders = DB::table('orders')
->orderByRaw('updated_at - created_at DESC')
->get();
orderByRaw
方法可用于将原生字符串设置为 order by
语句的值:
$orders = DB::table('orders')
->orderByRaw('updated_at - created_at DESC')
->get();