本文整理汇总了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);
}
示例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;
}
}
示例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' => 'Областта не е намерена.'));
}
}
示例4: getDistrictAttribute
public function getDistrictAttribute()
{
return District::find($this->district_id)->name;
}
示例5: getDistrict
protected function getDistrict($id)
{
$datas = District::find()->where(['AMPHUR_ID' => $id])->all();
return $this->MapData($datas, 'DISTRICT_ID', 'DISTRICT_NAME');
}
示例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'));
}
}
示例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'));
}