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


PHP Service::orderBy方法代码示例

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


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

示例1: packages

 public function packages()
 {
     $this->data['cycles'] = Cycle::all();
     $this->data['services'] = Service::orderBy('name')->get();
     $this->data['packages'] = Package::paginate(25);
     return $this->layout->content = View::make('packages', $this->data);
 }
开发者ID:jacobDaeHyung,项目名称:PHPLaravelGymManagementSystem,代码行数:7,代码来源:PackagesController.php

示例2: getAllServices

 public function getAllServices()
 {
     // services
     $all_services = Service::orderBy('name', 'ASC')->get(['id', 'name']);
     $services = [];
     foreach ($all_services as $service) {
         $services[] = (object) ['value' => $service->id, 'label' => utf8_encode($service->name)];
     }
     return $services;
 }
开发者ID:strikles,项目名称:php,代码行数:10,代码来源:traitGetAll.php

示例3: initialLoad

 public function initialLoad()
 {
     $advertisings = Advertising::orderBy('order', 'asc')->get();
     $budgets = Budget::orderBy('order', 'asc')->get();
     $doctors = Doctor::with('speciality')->get();
     $nav_menus = NavigationMenu::orderBy('order', 'asc')->get();
     $promos = Promo::all();
     $services = Service::orderBy('order', 'asc')->get();
     $slider_images = SliderImage::all();
     $specialities = Speciality::all();
     return View::make('layouts.main', array('advertisings' => $advertisings, 'budgets' => $budgets, 'doctors' => $doctors, 'nav_menus' => $nav_menus, 'promos' => $promos, 'services' => $services, 'slider_images' => $slider_images, 'specialities' => $specialities));
 }
开发者ID:Badillo,项目名称:hospitalcatalina-web,代码行数:12,代码来源:HomeController.php

示例4: getArea

 public function getArea()
 {
     $roles = Role::all();
     $services = Service::orderBy('action')->get();
     $services = $services->toArray();
     $groupedServices = [];
     foreach ($services as $service) {
         $actions = preg_split('/@/', $service['action']);
         if (count($actions) >= 2) {
             $groupedServices[$actions[0]][] = ['id' => $service['id'], 'libelle' => $actions[1]];
         }
     }
     $result = [];
     foreach ($roles as $role) {
         $result[] = ['libelle' => $role->libelle, 'id' => $role->id, 'choices' => $groupedServices];
     }
     return $result;
 }
开发者ID:SchizoDuckie,项目名称:Expendable,代码行数:18,代码来源:Permission.php

示例5: getData

 /**
  * [getData - datatables response]
  * @return [json] [DT compatible object]
  */
 public function getData()
 {
     $Model = $this->modelName;
     $num_skip = 0;
     $num_items = 10;
     $recordsTotal = 0;
     $recordsFiltered = 0;
     // check get vars
     if (isset($_GET['start'])) {
         $num_skip = (int) $_GET['start'];
     }
     if (isset($_GET['length'])) {
         $num_items = (int) $_GET['length'];
     }
     if (isset($_GET['search'])) {
         $search_value = $_GET['search']['value'];
     }
     $all_services = Service::orderBy('id', 'DESC');
     if (!empty($search_value)) {
         $all_services->whereRaw("(services.name LIKE '%" . $search_value . "%')");
     }
     $recordsTotal = $all_services->count();
     $recordsFiltered = $recordsTotal;
     if ($num_skip > 0) {
         $all_services->skip($num_skip);
     }
     $all_services = $all_services->orderBy('id', 'DESC')->take($num_items)->get();
     $data = [];
     foreach ($all_services as $service) {
         // load cat relation
         $load_curr_category = $service->category;
         $load_curr_status = $service->status;
         $load_curr_period = $service->period;
         //Debugbar::info($service);
         $curr_category = $service->category !== NULL ? (object) ['id' => $service->category->id, 'name' => utf8_encode($service->category->name)] : (object) null;
         $curr_status = $service->status !== NULL ? (object) ['id' => $service->status_id, 'description' => utf8_encode($service->status->description)] : (object) null;
         $curr_period = $service->period !== NULL ? (object) ['id' => $service->invoice_periods_id, 'description' => utf8_encode($service->period->description)] : (object) null;
         $data[] = (object) ['DT_RowId' => 'row_' . $service->id, 'service_categories' => $curr_category, 'services' => $service, 'statuses' => $curr_status, 'invoice_periods' => $curr_period];
     }
     $ret = ['recordsTotal' => $recordsTotal, 'recordsFiltered' => $recordsFiltered, 'data' => $data, 'service_categories' => $this->getAllServiceCategories(), 'statuses' => $this->getAllStatuses(), 'invoice_periods' => $this->getAllInvoicePeriods()];
     return Response::json($ret);
 }
开发者ID:strikles,项目名称:php,代码行数:46,代码来源:AdminServiceController.php

示例6: index

 /**
  * Display a listing of the resource.
  * GET /services
  *
  * @return Response
  */
 public function index()
 {
     $services = Service::orderBy('service')->get();
     return View::make('services.index')->withServices($services);
 }
开发者ID:BobbyHoltzner,项目名称:Laravel4CRM,代码行数:11,代码来源:ServicesController.php

示例7: services

 public function services()
 {
     $this->data['services'] = Service::orderBy('name')->paginate(10);
     return $this->layout->content = View::make('services', $this->data);
 }
开发者ID:jacobDaeHyung,项目名称:PHPLaravelGymManagementSystem,代码行数:5,代码来源:ServicesController.php


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