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


PHP Country::orderBy方法代码示例

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


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

示例1: index

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

示例2: edit

 public function edit($id)
 {
     $countries = Country::orderBy('name', 'asc')->lists('name', 'id')->all();
     $categories = Category::lists('category', 'category')->all();
     $competition = Competition::whereId($id)->firstOrFail();
     return view('backend.competitions.edit', compact('competition', 'countries', 'categories'));
 }
开发者ID:steve8809,项目名称:pentathlon_2015,代码行数:7,代码来源:CompetitionsController.php

示例3: edit

 public function edit($id)
 {
     $countries = Country::orderBy('name', 'asc')->lists('name', 'id')->all();
     $clubs = Club::orderBy('name', 'asc')->get()->lists('name_town', 'id')->all();
     $competitor = Competitor::whereId($id)->firstOrFail();
     return view('backend.competitors.edit', compact('competitor', 'countries', 'clubs'));
 }
开发者ID:steve8809,项目名称:pentathlon_2015,代码行数:7,代码来源:CompetitorsController.php

示例4: create

 public function create(ApplicationRequest $request)
 {
     $services = Service::join('service_visas', 'services.id', '=', 'service_visas.service_id')->select('services.id', 'services.name', 'min_process', 'max_process')->orderBy('min_process')->orderBy('max_process')->where('country_id', '=', $request->get('country'))->groupBy('services.id')->get();
     $service = $services->first();
     $states = DB::table('states')->orderBy('name', 'asc')->lists('name', 'id');
     $countries = Country::orderBy('name')->lists('name', 'id');
     $country = Country::find($request->get('country'));
     return View('apply', ['services' => $services->lists('title', 'id'), 'service' => $service, 'country' => $country, 'countries' => $countries, 'states' => $states]);
 }
开发者ID:zangee3,项目名称:avs,代码行数:9,代码来源:CartController.php

示例5: populateDropdowns

 public function populateDropdowns()
 {
     $populatecountry = Country::orderBy('created_at', 'asc')->paginate(100);
     $populatemunicipality = Municipality::orderBy('created_at', 'asc')->paginate(100);
     $populateregion = Region::orderBy('created_at', 'asc')->paginate(100);
     $populateschool_level = School_level::orderBy('created_at', 'asc')->paginate(100);
     $populateschool_type = School_type::orderBy('created_at', 'asc')->paginate(100);
     $populateacademic_year = Academic_year::orderBy('created_at', 'asc')->paginate(100);
     $populatetemplate = Template::orderBy('created_at', 'asc')->paginate(100);
     $site_code = Settings::first()->site_code;
     $site_title = Settings::first()->site_title;
     $owner = Settings::first()->owner;
     $street = Settings::first()->street;
     $barangay = Settings::first()->barangay;
     $zip_code = Settings::first()->zip_code;
     $contact = Settings::first()->contact;
     $fax = Settings::first()->fax;
     $tin = Settings::first()->tin;
     //$posts=Post::orderBy('created_at','desc')->paginate(15);
     //return view('general-settings',['populatecountry' => $populatecountry]);
     return view('general-settings')->with('populatecountry', $populatecountry)->with('populatemunicipality', $populatemunicipality)->with('populateregion', $populateregion)->with('populateschool_level', $populateschool_level)->with('populateschool_type', $populateschool_type)->with('populateacademic_year', $populateacademic_year)->with('populatetemplate', $populatetemplate)->with('site_code', $site_code)->with('site_title', $site_title)->with('owner', $owner)->with('street', $street)->with('barangay', $barangay)->with('zip_code', $zip_code)->with('contact', $contact)->with('fax', $fax)->with('tin', $tin);
 }
开发者ID:megmarcaida,项目名称:smixs,代码行数:22,代码来源:SettingsController.php

示例6: getBackground

 public function getBackground(Request $request)
 {
     $num = $request->has("rows") ? Input::get("rows") : 25;
     $sort = $request->has("sort") ? Input::get("sort") : 'id';
     $order = $request->has("order") ? Input::get("order") : 'asc';
     $filterRules = $request->has("filterRules") ? Input::get("filterRules") : null;
     $filterRules = json_decode($filterRules, 1);
     $pages = Country::orderBy($sort, $order);
     if (!is_null($filterRules)) {
         foreach ($filterRules as $item) {
             if ($item['op'] == 'contains') {
                 $pages = $pages->where($item['field'], 'like', '%' . $item['value'] . '%', "and");
             }
         }
     }
     $pages = $pages->paginate($num);
     //var_dump($pages->toArray());
     $data = $pages->toArray();
     $result = array();
     $result["total"] = $data['total'];
     $result["rows"] = $data['data'];
     return json_encode($result);
 }
开发者ID:ChenPeiyuan,项目名称:student-infomation-manager,代码行数:23,代码来源:CountryManageController.php

示例7: all

 /**
  * Returns a collection with all countries.
  *
  * @return Collection
  */
 public function all()
 {
     return Country::orderBy('name')->get();
 }
开发者ID:manishkiozen,项目名称:Cms,代码行数:9,代码来源:CountryRepository.php

示例8: getCountry

 public function getCountry()
 {
     $country = Country::orderBy('created_at', 'desc')->paginate(10);
     //$posts=Post::orderBy('created_at','desc')->paginate(15);
     return view('country', ['country' => $country]);
 }
开发者ID:megmarcaida,项目名称:smixs,代码行数:6,代码来源:CountryController.php

示例9: settings

 public function settings()
 {
     $platforms = \App\Platform::all();
     $countries = \App\Country::orderBy('name', 'asc')->get();
     return view('user/settings', compact('platforms', 'countries'));
 }
开发者ID:messerli90,项目名称:division-agents,代码行数:6,代码来源:UserController.php

示例10: getAllCountries

 public function getAllCountries()
 {
     return Country::orderBy('country_name')->get();
 }
开发者ID:skiwei,项目名称:sayangholidays,代码行数:4,代码来源:CountryRepository.php

示例11: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit()
 {
     //
     $gender = Gender::lists('gender', 'id');
     $age = Age::lists('age', 'id');
     $occupation = Occupation::lists('occupation', 'id');
     $country = Country::orderBy('country')->lists('country', 'id');
     //for alphabetic order
     $education = Education::lists('education', 'id');
     //return Auth::User()->profile;
     return view('user.edit', compact('gender', 'age', 'occupation', 'country', 'education'));
 }
开发者ID:skafetzo,项目名称:SPtool,代码行数:18,代码来源:ProfileController.php

示例12: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show(Request $request, $id)
 {
     $visa = Visa::findOrFail($id);
     $countries = Country::orderBy('name')->get();
     return view("admin.visa_show", ["visa" => $visa, "countries" => $countries]);
 }
开发者ID:zangee3,项目名称:avs,代码行数:12,代码来源:VisasController.php

示例13: countries

 public function countries()
 {
     $countries = Country::orderBy('country_code', 'asc')->get();
     return view('scrapers.countries')->with(['countries' => $countries]);
 }
开发者ID:jedlicka82,项目名称:pragueairport,代码行数:5,代码来源:BackdoorController.php


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