当前位置: 首页>>代码示例>>PHP>>正文


PHP Registration::orderBy方法代码示例

本文整理汇总了PHP中Registration::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Registration::orderBy方法的具体用法?PHP Registration::orderBy怎么用?PHP Registration::orderBy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Registration的用法示例。


在下文中一共展示了Registration::orderBy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 /**
  * Displays a tabular list of registrations.
  */
 public function index()
 {
     $this->layout->with('subtitle', 'Registrations');
     $registrations = Registration::orderBy('registrations.created_at', 'desc')->join('bookings', 'registrations.booking_id', '=', 'bookings.id', 'left outer')->addSelect('registrations.*')->addSelect('bookings.first')->addSelect('bookings.last')->addSelect('bookings.email');
     $filtered = false;
     $filter_name = Session::get('registrations_filter_name', '');
     $filter_email = Session::get('registrations_filter_email', '');
     $filter_friday = Session::get('registrations_filter_friday', '');
     $filter_saturday = Session::get('registrations_filter_saturday', '');
     if (!empty($filter_name)) {
         $registrations = $registrations->where(function ($query) use($filter_name) {
             $query->where('bookings.first', 'LIKE', "%{$filter_name}%")->orWhere('bookings.last', 'LIKE', "%{$filter_name}%")->orWhere('registrations.name', 'LIKE', "%{$filter_name}%");
         });
         $filtered = true;
     }
     if (!empty($filter_email)) {
         $registrations = $registrations->where(function ($query) use($filter_email) {
             $query->where('bookings.email', 'LIKE', "%{$filter_email}%")->orWhere('registrations.email_address', 'LIKE', "%{$filter_email}%");
         });
         $filtered = true;
     }
     if (!empty($filter_friday)) {
         $registrations = $registrations->where(DB::raw('DAYOFWEEK(registrations.created_at)'), '=', 6);
         $filtered = true;
     }
     if (!empty($filter_saturday)) {
         $registrations = $registrations->where(DB::raw('DAYOFWEEK(registrations.created_at)'), '=', 7);
         $filtered = true;
     }
     $registrations = $registrations->paginate(25);
     $this->layout->content = View::make('registrations.index')->with('registrations', $registrations)->with('filtered', $filtered)->with('filter_name', $filter_name)->with('filter_email', $filter_email)->with('filter_friday', $filter_friday)->with('filter_saturday', $filter_saturday);
 }
开发者ID:ajwgibson,项目名称:capacity,代码行数:35,代码来源:RegistrationController.php

示例2: getRankedsub

 public function getRankedsub()
 {
     return var_dump(Registration::orderBy("rank", "ASC")->get()->toArray());
 }
开发者ID:WolfUser,项目名称:UCLoL,代码行数:4,代码来源:RestController.php


注:本文中的Registration::orderBy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。