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


PHP District::find方法代码示例

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


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

示例1: processDistrict

 public function processDistrict($patientquery, $visitquery, $value, $title = "")
 {
     if ($value != "all") {
         $title .= District::find($value)->district . " District ";
         $patientquery->whereIn('id', PatientReport::where('district', $value)->get()->lists('patient_id') + array('0'));
         $visitquery->whereIn('id', PatientInfo::where('district', $value)->get()->lists('visit_id') + array('0'));
     }
     return array($patientquery, $visitquery, $title);
 }
开发者ID:kelvinmbwilo,项目名称:cervical,代码行数:9,代码来源:BaseController.php

示例2: isexist

 function isexist($zipcode)
 {
     $Model_B = new District();
     $valid = $Model_B->find('count', array('conditions' => array('District.district_code' => $zipcode)));
     if ($valid == 1) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:Betasoft111,项目名称:notifywebapp,代码行数:10,代码来源:School.php

示例3: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $district = District::find($id);
     if (!is_null($district)) {
         if ($district->delete()) {
             return Redirect::route('admin.districts.index')->withErrors(array('mainSuccess' => 'Областта е успешно изтрита.'));
         } else {
             return Redirect::route('admin.districts.index')->withErrors(array('mainError' => 'Грешка с базата данни.'));
         }
     } else {
         return Redirect::route('admin.districts.index')->withErrors(array('mainError' => 'Областта не е намерена.'));
     }
 }
开发者ID:mertindervish,项目名称:registerbg,代码行数:19,代码来源:AdminDistrictController.php

示例4: getDistrictAttribute

 public function getDistrictAttribute()
 {
     return District::find($this->district_id)->name;
 }
开发者ID:mertindervish,项目名称:registerbg,代码行数:4,代码来源:School.php

示例5: getDistrict

 protected function getDistrict($id)
 {
     $datas = District::find()->where(['AMPHUR_ID' => $id])->all();
     return $this->MapData($datas, 'DISTRICT_ID', 'DISTRICT_NAME');
 }
开发者ID:jaradsee,项目名称:rmfaktha,代码行数:5,代码来源:RiskHeadController.php

示例6: addressMetaData

 function addressMetaData($action)
 {
     //        $optionState = array();
     //        $optionState['order'] = array('state_name' => 'asc', 'active' => '1');
     //        $optionState['conditions'] = array('zone_id' => $address['zone_id'], 'active' => '1');
     if (isset($this->params['named']['copy_address']) || $action == 'edit' || $action == 'copy') {
         App::import('Model', 'Country');
         $objCountry = new Country();
         App::import('Model', 'Zone');
         $objZone = new Zone();
         App::import('Model', 'State');
         $objState = new State();
         App::import('Model', 'District');
         $objDistrict = new District();
         App::import('Model', 'City');
         $objCity = new City();
         $optionZone = array();
         $optionDistrict = array();
         $optionCity = array();
         if (!empty($this->viewVars[lcfirst($this->modelClass)]['Address'])) {
             $address = $this->viewVars[lcfirst($this->modelClass)]['Address'];
             $optionCountry['conditions'] = array('id' => $address['country_id'], 'active' => '1');
             $optionZone['conditions'] = array('id' => $address['zone_id'], 'active' => '1');
             $optionState['conditions'] = array('id' => $address['state_id'], 'active' => '1');
             $optionDistrict['conditions'] = array('id' => $address['district_id'], 'active' => '1');
             $optionCity['conditions'] = array('id' => $address['city_id'], 'active' => '1');
         }
         $countries = $objCountry->find('list', $optionCountry);
         $zones = $objZone->find('list', $optionZone);
         $states = $objState->find('list', $optionState);
         $districts = $objDistrict->find('list', $optionDistrict);
         $cities = $objCity->find('list', $optionCity);
         $this->set(compact('countries', 'zones', 'states', 'districts', 'cities'));
     }
 }
开发者ID:shashin62,项目名称:abc_audit,代码行数:35,代码来源:app_controller.php

示例7: edit

 /**
  * Show the form for editing the specified district.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $district = District::find($id);
     return View::make('districts.edit', compact('district'));
 }
开发者ID:salmgazer,项目名称:yaresa-web,代码行数:11,代码来源:DistrictsController.php


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