當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。