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


PHP Location::orderBy方法代码示例

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


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

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $locations = Cache::remember('locations', 15, function () {
         return Location::orderBy('name')->get();
     });
     return response()->json(['data' => $locations], 200);
 }
开发者ID:wyrover,项目名称:refund-api,代码行数:12,代码来源:LocationController.php

示例2: create

 public function create()
 {
     $locations = Location::orderBy('name_eng', 'asc')->lists('name_eng', 'id');
     $sub_locations = Sub_location::orderBy('name_eng', 'asc')->lists('name_eng', 'id');
     $addresses = Address::orderBy('name_eng', 'asc')->lists('name_eng', 'id');
     $car_types = Car_type::select(DB::raw("name_eng || ' (max ' || max_passengers || ' passengers)' AS car_type, id"))->lists('car_type', 'id');
     return view('booking.create')->with(['car_types' => $car_types, 'locations' => $locations, 'sub_locations' => $sub_locations, 'addresses' => $addresses]);
 }
开发者ID:jedlicka82,项目名称:transferpraha,代码行数:8,代码来源:BookingController.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $locations = Location::orderBy('id', 'desc')->get();
     return view('locations.index', compact('locations'));
 }
开发者ID:acuccia,项目名称:remote-viewing,代码行数:10,代码来源:LocationsController.php

示例4: index

 /**
  * Display a list of all of the locations
  *
  * @param  Request  $request
  * @return Response
  */
 public function index(Request $request)
 {
     $locations = Location::orderBy('name', 'asc')->get();
     return view('locations.index', ['locations' => $locations]);
 }
开发者ID:aducworth,项目名称:inventory,代码行数:11,代码来源:LocationController.php

示例5: edit

 /**
  * Ddit product
  *
  * @param  Request  $request
  * @return Response
  */
 public function edit(Request $request, Product $product)
 {
     $stores = Store::orderBy('name')->lists('name', 'id');
     $locations = Location::orderBy('name')->lists('name', 'id');
     $sources = Source::orderBy('name')->lists("name", 'id');
     return view('products.input', ['stores' => $stores, 'locations' => $locations, 'sources' => $sources, 'product' => $product, 'product_statuses' => $this->product_statuses]);
 }
开发者ID:aducworth,项目名称:inventory,代码行数:13,代码来源:ProductController.php

示例6: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $locations = Location::orderBy('address')->orderBy('number')->get();
     return view('locations.index', compact('locations'));
 }
开发者ID:elconejito,项目名称:RabbitHome,代码行数:10,代码来源:LocationController.php

示例7: index

 public function index()
 {
     $locations = Location::orderBy('id', 'ASC')->paginate(15);
     return view('locations.index', ['locations' => $locations]);
 }
开发者ID:TheJokersThief,项目名称:Eve,代码行数:5,代码来源:LocationController.php

示例8: getAllLocations

 /**
  * @param string $order_by
  * @param string $sort
  * @return mixed
  */
 public function getAllLocations($order_by = 'id', $sort = 'asc')
 {
     return Location::orderBy($order_by, $sort)->get();
 }
开发者ID:herzcthu,项目名称:Laravel-HS,代码行数:9,代码来源:EloquentLocationRepository.php

示例9: index

 public function index()
 {
     $locations = Location::orderBy('created_at', 'desc')->paginate(20);
     return view('locations.index', compact('locations'));
 }
开发者ID:vasitjuntong,项目名称:mixed,代码行数:5,代码来源:LocationController.php

示例10: locations

 public function locations()
 {
     $locations = Location::orderBy('created_at', 'desc')->get();
     return view('locations.admin', compact('locations'));
 }
开发者ID:ripixel,项目名称:polefitness,代码行数:5,代码来源:AdminController.php


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