本文整理汇总了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'));
}
示例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'));
}
示例3: mostrar_lugar
public function mostrar_lugar()
{
$lugares = Place::orderBy('lugar_nombre')->paginate(10);
return View::make('lugar.listaLugar', array('lugares' => $lugares));
}