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


PHP Area::getCities方法代码示例

本文整理汇总了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);
    }/*}}}*/
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:38,代码来源:hospitalbyarea.php

示例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 }}?>
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:31,代码来源:ajaxchangecity.php


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