阅读(1900)
赞(18)
Laravel 8 orderByRaw
2021-07-07 09:14:22 更新
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();