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


PHP Place::orderBy方法代碼示例

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


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

示例1: showEditEvent

 /**
  * Generate the view for editing an event specified by $id.
  *
  * @param int $id
  * @return view editClubEventView
  */
 public function showEditEvent($id)
 {
     $event = ClubEvent::findOrFail($id);
     $schedule = $event->getSchedule()->getResults();
     $jobtypes = Jobtype::where('jbtyp_is_archived', '=', '0')->orderBy('jbtyp_title', 'ASC')->get();
     $places = Place::orderBy('plc_title', 'ASC')->lists('plc_title', 'id');
     $templates = Schedule::where('schdl_is_template', '=', '1')->orderBy('schdl_title', 'ASC')->get();
     $template = Schedule::where('id', '=', $schedule->id)->first();
     // put template data into entries
     $entries = $schedule->getEntries()->with('getJobType')->getResults();
     // put name of the active template for further use
     $activeTemplate = $template->schdl_title;
     return View::make('editClubEventView', compact('event', 'schedule', 'places', 'jobtypes', 'templates', 'template', 'entries', 'activeTemplate'));
 }
開發者ID:gitter-badger,項目名稱:lara-vedst,代碼行數:20,代碼來源:EventController.php

示例2: updatePlaces

 /**
  * Updates all existing places with changes provided.
  *
  * @return view placeManagementView
  */
 public function updatePlaces()
 {
     $places = Place::orderBy('plc_title', 'ASC')->get();
     foreach ($places as $place) {
         if (Input::get('destroy' . $place->id)) {
             // find all schedules that use this place and replace it with a placeholder
             $filter = ClubEvent::where('plc_id', '=', $place->id)->get();
             foreach ($filter as $event) {
                 $event->plc_id = 0;
                 // placeholder with plc_title "-"
                 $event->save();
             }
             Place::destroy($place->id);
         } else {
             // update title
             $place->plc_title = Input::get('plc_title' . $place->id);
             $place->save();
         }
     }
     // need to update our index after the changes
     $places = Place::orderBy('plc_title', 'ASC')->get();
     return View::make('placeManagementView', compact('places'));
 }
開發者ID:gitter-badger,項目名稱:lara-vedst,代碼行數:28,代碼來源:ManagementController.php

示例3: mostrar_lugar

 public function mostrar_lugar()
 {
     $lugares = Place::orderBy('lugar_nombre')->paginate(10);
     return View::make('lugar.listaLugar', array('lugares' => $lugares));
 }
開發者ID:bmrpas,項目名稱:SHREDDER,代碼行數:5,代碼來源:LugarController.php


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