Laravel 分页顺序

2022-01-08 00:00:00 php laravel laravel-4

我应该怎么做才能传递您在 patinate 中排序的值?

What should I do to pass the values ​​that you order by in patinate?

routes.php

$ondata = DB::table('official_news') -> orderBy('created_date', 'desc') -> get() -> paginate(7);
return View::make('main',array('ondata' => $ondata));

错误

Call to a member function paginate() on a non-object

我需要你的帮助

推荐答案

这应该可以解决问题:

$ondata = DB::table('official_news')->orderBy('created_date', 'desc')->paginate(7);

相关文章