當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。