本文整理匯總了PHP中Area::getCities方法的典型用法代碼示例。如果您正苦於以下問題:PHP Area::getCities方法的具體用法?PHP Area::getCities怎麽用?PHP Area::getCities使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Area
的用法示例。
在下文中一共展示了Area::getCities方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getAreaHospitalData
private function getAreaHospitalData($nowPage, $pageSize)
{/*{{{*/
$res = array();
$cityRes = $proviceRes = array();
$provinceList = Area::getAllProvinceNameList();
$cityList = Area::getCities();
foreach($provinceList as $province)
{
echo date('Y-m-d H:i:s')."計算".$province."的數據。。。。\n";
foreach($cityList[$province] as $city)
{
if($province != $city)
{
$cityParams = array('province'=>$province, 'city'=>$city);
//通過市級查詢
$itemCity = $this->buildAreaData($cityParams, $nowPage, $pageSize);
if(false == empty($itemCity))
{
$cityRes[] = $itemCity;
}
unset($itemCity);
}
BeanFinder::get('LocalCache')->removeAll();
}
//通過省級查詢
$provinceParams = array('province'=>$province);
$itemProvice = $this->buildAreaData($provinceParams, $nowPage, $pageSize);
if(false == empty($itemProvice))
{
$proviceRes[] = $itemProvice;
}
unset($itemProvice);
BeanFinder::get('LocalCache')->removeAll();
}
$data = array_merge($cityRes, $proviceRes);
return $this->formatData($data);
}/*}}}*/
示例2: foreach
$defaultOpenedTriageCities = Area::getDefaultOpenedTriageCities();
foreach(Area::getDefaultOpenedTriageCities() as $key=>$values){?>
<li><span class="lg-space-list-span"><?=$key ?></span>
<span class="lg-space-list-span1">
<?php
if(is_array($values))
{
foreach($values as $city){ ?>
<a class="blue" onclick="setMcity('<?=$city?>',31536000);hdf.set_cookie('b[change]', 1, 0);location.replace(location.href);return false;" href=""><?=$city?></a>
<?php }
} else {?>
<a class="blue" onclick="setMcity('<?=$city?>',31536000);hdf.set_cookie('b[change]', 1, 0);location.replace(location.href);return false;" href=""><?=$values?></a>
<?php }?>
</span></li>
<?php }?>
<?php foreach(Area::getCities() as $key => $values) {
if(!in_array($key,array_keys($defaultOpenedTriageCities))){
?>
<li><span class="lg-space-list-span"><?=$key ?></span>
<span class="lg-space-list-span1">
<?php
if(is_array($values))
{
foreach($values as $city){?>
<a class="blue" onclick="setMcity('<?=$city?>',31536000);hdf.set_cookie('b[change]', 1, 0);location.replace(location.href);return false;" href=""><?=$city?></a>
<?php }
} else {?>
<a class="blue" onclick="setMcity('<?=$city?>',31536000);hdf.set_cookie('b[change]', 1, 0);location.replace(location.href);return false;" href=""><?=$values?></a>
<?php }?>
</span></li>
<?php }}?>