當前位置: 首頁>>代碼示例>>PHP>>正文


PHP News::orderBy方法代碼示例

本文整理匯總了PHP中app\models\News::orderBy方法的典型用法代碼示例。如果您正苦於以下問題:PHP News::orderBy方法的具體用法?PHP News::orderBy怎麽用?PHP News::orderBy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\models\News的用法示例。


在下文中一共展示了News::orderBy方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: index

 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     $Model = new News();
     $News = $Model->orderBy('id', 'DESC');
     $News = $this->paging($News, $request, false);
     $data = ["title" => "Tin tức", 'news' => $News, 'total' => $this->total, 'total_page' => $this->total_page];
     return View::make('user/news', $data);
 }
開發者ID:dao94,項目名稱:game,代碼行數:13,代碼來源:NewsController.php

示例2: getLogin

 public function getLogin()
 {
     if (Auth::check()) {
         return redirect('game');
     }
     $news = News::orderBy('date', 'desc')->paginate(3);
     return view('auth/login', ['news' => $news]);
 }
開發者ID:nvchernov,項目名稱:tsargrad,代碼行數:8,代碼來源:AuthController.php

示例3: index

 public function index()
 {
     $items = News::orderBy('created_at', 'desc')->take(10)->get();
     $data = array();
     foreach ($items as $k => $v) {
         $data[] = array('title' => $v->title, 'description' => $v->content, 'link' => url($v->url));
     }
     $feed = Feeder::feed($data);
     return Response::make($feed, 200, array('Content-Type' => 'text/xml'));
 }
開發者ID:phillipmadsen,項目名稱:app,代碼行數:10,代碼來源:RssController.php

示例4: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $news = News::orderBy('created_at', 'DESC')->paginate(5);
     return view('news.index', compact('news'));
 }
開發者ID:danielchikaka,項目名稱:osh,代碼行數:10,代碼來源:NewsController.php

示例5: index

 public function index()
 {
     $news = Models\News::orderBy('created', 'desc')->get();
     return view('news.list', ['news' => $news]);
 }
開發者ID:valdars,項目名稱:qdb,代碼行數:5,代碼來源:NewsController.php

示例6: getRolesPaginated

 /**
  * @param $per_page
  * @param string $order_by
  * @param string $sort
  * @return mixed
  */
 public function getRolesPaginated($per_page, $order_by = 'id', $sort = 'asc')
 {
     return News::orderBy($order_by, $sort)->paginate($per_page);
 }
開發者ID:aysenli,項目名稱:laravel5-backend,代碼行數:10,代碼來源:NewsRepository.php

示例7: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $news = News::orderBy('id', 'desc')->paginate(10);
     return view('admin.news.index', compact('news'));
 }
開發者ID:lyovkin,項目名稱:elcoinbank,代碼行數:10,代碼來源:AdminNewsController.php

示例8: latest

 public static function latest($n = 6)
 {
     return News::orderBy('created_at', 'DESC')->limit($n)->get();
 }
開發者ID:danielchikaka,項目名稱:osh,代碼行數:4,代碼來源:News.php


注:本文中的app\models\News::orderBy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。