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