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


PHP City::all方法代码示例

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


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

示例1: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $place = Place::with(['city', 'category'])->whereId($id)->first();
     $categories = Category::all();
     $cities = City::all();
     return view('client.placeinfo', compact('place', 'categories', 'cities'));
 }
开发者ID:rodiaa,项目名称:trpo,代码行数:13,代码来源:PlaceController.php

示例2: allCity

 public function allCity()
 {
     $response = array();
     $infos = City::all();
     if (!empty($infos)) {
         foreach ($infos as $info) {
             $response[] = array("info_id" => $info['id'], "data_description" => $info['city']);
         }
     }
     return $response;
 }
开发者ID:jhunel2389,项目名称:hp-sis,代码行数:11,代码来源:GlobalController.php

示例3: getReceiverinfo

  public function getReceiverinfo (Request $request)
  {
    $user = Auth::user();

    $receiverInfoSet = ReceiverInfo::where('uid', '=', $user->id)

      ->where('active', '=', '1')

      ->orderBy('last_used', 'desc')

      ->orderBy('created_at', 'desc')

      ->get();

    $provinceSet = Province::all();      

    $provinces = array();

    foreach ($provinceSet as $province) {
    
      array_push($provinces, $province);
    
    }

    $cities = City::all();

    $districts = array();

    foreach ($cities as $city) {
    
      $district = District::where('city_code', '=', $city->code) 

        ->where('active', '=', '1')

        ->first();

      if ($district) {

        array_push($districts, $district);
    
      }

    }

    $receiverInfos = array();

    foreach ($receiverInfoSet as $receiverInfo) {
    
      array_push($receiverInfos, $receiverInfo);
    
    }

    $data = [
    
      'receiverInfos' => $receiverInfos,

      'provinces' => $provinces,

      'cities' => $cities,

      'districts' => $districts,

      'receiverActive' => true,

      'wTitle' => '个人中心 - 收货人信息'
    
    ];

    return view('profile/receiver_info', $data);
  
  }
开发者ID:kukujiabo,项目名称:linpai,代码行数:71,代码来源:ProfilesController.php

示例4: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $cities = City::all();
     return view('admin.city', compact('cities'));
 }
开发者ID:rodiaa,项目名称:trpo,代码行数:10,代码来源:CityController.php

示例5: index

 public function index()
 {
     return view('admin.cities.list', array('cities' => City::all()));
     //return view('admin.cities.list');
 }
开发者ID:Zuviaganys,项目名称:lesson,代码行数:5,代码来源:AdminCitiesController.php

示例6: show

 public function show()
 {
     $cityCollection = City::all();
     return response()->json($cityCollection);
 }
开发者ID:liuzhaowei55,项目名称:Moorper,代码行数:5,代码来源:CityController.php


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