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


PHP Project::orderby方法代碼示例

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


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

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index($current_page)
 {
     $current_page = $current_page ? $current_page : 1;
     $current_page = $current_page - 1;
     $page = 10;
     //echo $current_page*$page;exit;
     $post = Project::orderby('projects_id', 'desc')->offset($current_page * $page)->limit($page);
     $posts['data'] = $post->get();
     $posts['count'] = Project::count();
     $posts['pageSize'] = $page;
     $posts['pageSize'] = $page;
     return response()->json($posts);
 }
開發者ID:QiuCarson,項目名稱:doc,代碼行數:18,代碼來源:ProjectsController.php

示例2: addshow

 public function addshow()
 {
     //網站列表
     $data['websites'] = Website::orderby('websites_id', 'desc')->get();
     $data['projects'] = Project::orderby('projects_id', 'desc')->get();
     $data['posts_content'] = file_get_contents("http://www.doc.com/app/admin/tpl/posts/default.html");
     return response()->json(['status' => true, 'message' => '數據查詢成功', 'data' => $data]);
 }
開發者ID:QiuCarson,項目名稱:doc,代碼行數:8,代碼來源:PostController.php

示例3: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $data['card'] = $card = Card::find($id);
     if ($card) {
         $data['sectors'] = Sector::lists('name', 'id');
         $data['districts'] = District::groupby($this->district)->lists($this->district, 'id');
         $data['projects'] = Project::orderby('name', 'asc')->lists('name', 'id');
         $data['listbtn'] = Permission::hasPermission('cards.update');
         return view('cards.edit', $data);
     } else {
         Session::flash('danger', Lang::get('ruban.card.notfound'));
         return Redirect::route('ruban.cards.index');
     }
 }
開發者ID:mahitiinfo,項目名稱:rubanbridge,代碼行數:20,代碼來源:CardController.php


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