本文整理汇总了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 }}?>